NativeTernary: A Self-Delimiting Binary Encoding with Unary Run-Length Hierarchy Markers for Ternary Neural Network Weights, Structured Data, and General Computing Infrastructure

arXiv cs.LG / 4/7/2026

💬 OpinionDeveloper Stack & InfrastructureSignals & Early TrendsIdeas & Deep AnalysisModels & Research

Key Points

  • NativeTernary is a proposed binary wire format that natively encodes ternary symbols (balanced {-1,0,+1} or unsigned {0,1,2}) using a reserved delimiter plus a structured 2-bit pair mapping.
  • The scheme’s key novelty is unary run-length encoding of consecutive delimiter pairs to represent hierarchy depth, assigning bit costs that scale with boundary rarity for character/word/sentence/paragraph/topic boundaries.
  • It offers multiple delimiter variants ({11} as the primary option for simple detection and {00} as an ultra-low-power CMOS-oriented alternative), and includes design variants such as a dual-starter namespace design.
  • The paper claims NativeTernary can support “ternary-native” computing infrastructure with no hardware changes, targeting uses from ternary neural network weight storage to edge/IoT/sensor and telemetry data.
  • The decoder is described as a very compact, stateless state machine (about 10 lines) and resilient to bitstream corruption, strengthening its case for embedded/robust deployment.

Abstract

BitNet b1.58 (Ma et al., 2024) demonstrates that large language models can operate entirely on ternary weights {-1, 0, +1}, yet no native binary wire format exists for such models. NativeTernary closes this gap. We present NativeTernary, a binary encoding scheme that partitions the 2-bit pair space into three data symbols representing ternary values -- either balanced {-1, 0, +1} or unsigned {0, 1, 2} -- and a reserved structural delimiter. The central contribution is the use of unary run-length encoding to represent semantic hierarchy depth: a sequence of N consecutive delimiter pairs denotes a boundary of level N, encoding character, word, sentence, paragraph, and topic boundaries at cost 2, 4, 6, 8, and 10 bits respectively -- proportional to boundary rarity. The choice of which 2-bit pair serves as the delimiter is a design parameter: {11} is the primary embodiment, offering simple OR-gate detection; {00} is an alternative embodiment optimised for ultra-low-power CMOS systems, minimising switching activity. All four bit-pair choices are covered by the patent claims. We present three encoding variants: (1) the primary scheme with {11} as sole delimiter; (2) a dual-starter variant where both {10} and {11} initiate distinct symbol namespaces; and (3) an analysis of unsigned versus balanced ternary data mappings. We describe a path toward ternary-native general computing infrastructure requiring no hardware changes, and outline applications spanning ternary neural network weight storage, hierarchical natural language encoding, edge computing, IoT and satellite telemetry, industrial sensors, automotive systems, medical devices, gaming, and financial tick data. The decoder is a 10-line stateless state machine resilient to bitstream corruption.