Hook: During an evening scroll through my feed, I caught a Habr series about Soviet computerization — Gosbank, polyclinics, school classrooms with "Nairi" and "Agat." In the comments, people were asking to "elaborate on Setun." I got hooked: for me, "Setun" had always been just an amusing curiosity — you know, the USSR built some kind of ternary computer, go big or go home. But when I dug deeper to verify, something far more unsettling emerged: the binary nature of our computers is not an engineering truth but a historical accident, and mathematics directly states that the optimal number base is not two, but three. Moreover, this fact is now, in the AI era, quietly emerging from the archives: in 2024, Microsoft released a language model whose weights use exactly the same ternary logic as the 1958 Soviet machine. The topic had only been touched on in one paragraph of someone else's story in the archive — the ternary computer as a phenomenon hadn't been examined here by anyone. Let's go.
Investigation:
Let's start with a question almost no one asks: why zero and one anyway? The answer "because a transistor is open/closed" — that's an engineer's answer, not a mathematician's. A mathematician frames the question differently: if a number system has base r, then any number from zero to N is represented by w digits, where w ≈ log(N)/log(r). Each position is a physical device that must distinguish r states. So the "cost" of representation is roughly the product r·w: both depth (how many symbols to distinguish) and width (how many cells to occupy) cost hardware. Minimize the product — and after a short derivative you get a result that makes you want to double-check: the optimum is reached at base e = 2.718... — that very Euler's number, the base of natural logarithms.
The number e is irrational; you can't physically build a number system with a fractional base. But among integers, the nearest neighbor of e is three. In the classic article "Third Base" (American Scientist, 2001), Brian Hayes calculated a concrete example: to represent all numbers from 0 to 999,999, the decimal system needs 6 digits (cost 60), binary needs 20 bits (cost 40), and ternary needs just 13 trits (cost 39). Ternary beats binary. And it beats it not in isolated cases: Hayes provides analysis showing that across all number system "capacities," ternary loses to binary only on a finite, relatively small set of values, while outperforming it on an infinite set. Donald Knuth — yes, that one, from "The Art of Computer Programming" — publicly mused in 2001 that the binary system "led us astray," and regretted that the "flip-flop" was never replaced by its ternary brother "flip-flap-flop." He even called the balanced ternary system "perhaps the prettiest number system of all" — and this is someone who reread his own work more often than we reread our favorite book.
Why "prettiest"? Because the real gem is not simply the ternary system {0, 1, 2}, but balanced ternary with digits −1, 0, +1. In it, the sign of a number is simply the sign of the most significant digit: no need for a separate sign bit, no need for separate rules for negative numbers. Rounding to the nearest power of three is achieved by zeroing the lower digits — something that in binary architecture required inventing separate FPU rounding modes happens automatically here. Sign change — inversion of all trits. The multiplication table is trivial: −1×−1=1, done. Thomas Fowler, a carpenter from Torrington, England, was the first to appreciate this: in 1840 he built a mechanical calculating machine using balanced ternary code — a century before the first electronic computer, 117 years before "Setun." And if you like puzzles, that very system lives in the classic problem of weights: with four weights of 1, 3, 9, and 27 grams you can weigh any integer weight from 1 to 40 — because each weight can go on either of two pans or stay in the box. Pure ternary.
Now let's move to Moscow, 1956. Academician Sergey Sobolev — one of the fathers of the Soviet nuclear program on the computational side — conceives a small computer for universities, design bureaus, and factories: cheap, simple, reliable. At the Moscow State University computing center, they assemble a group of nine young people; mathematicians of the caliber of Shura-Bura and Semendyaev sit in on the seminar. The key engineering idea comes from energy faculty graduate Nikolai Brusentsov: transistors are scarce in the country, vacuum tubes unreliable — but ferrite cores with semiconductor diodes are cheap, miniature, and radiation-resistant. You can build threshold logic on them. And a threshold element naturally gives three stable states, not two.
The name came from the Setun River, which flows into the Moskva River near the university — an absolutely homey name for a machine that's now in every textbook on the history of computing. In December 1958, the prototype was ready — two years from the group's start. And here's a detail that makes any engineer's heart skip: the machine worked correctly immediately, without debugging, and began executing already existing programs. Official tests in April 1960 were brilliant: phenomenal reliability for that era, stable operation across wide ranges of temperature and supply voltage. Recommended for production. The Kazan Mathematical Machines Plant eventually produced about 50 machines — 30 of them went to universities from Kaliningrad to Yakutsk, the rest to factories and research institutes.
What could "Setun" do? 18-trit word (roughly like 28.5 bits), 200 kHz clock frequency, 4,500 operations per second, 162-word RAM and magnetic drum. The numbers are laughable, but the architecture matters: balanced ternary encoding meant conditional branches needed half as many, arithmetic freely worked with operands of different lengths, and "perfect rounding" came from simple truncation. Machine language — 24 instructions, three of which never proved necessary: a telling display of the designers' honesty. One trit was physically stored in a pair of ferrite cores — and this, by the way, is the Achilles heel of the whole aesthetic: a pair of cores could store two bits, meaning more information than one trit. The mathematical advantage of ternary was partially eaten by an element base that lacked a "true" three-stable carrier.
And here the drama begins. According to Brusentsov's own recollections, computer industry officials met the "unplanned fruit of university fantasy" with hostility — a nonstandard machine falling outside departmental plans was methodically suppressed: there were orders, including export ones, but they produced 10–15 machines per year and didn't export a single one; the planned production in Czechoslovakia was killed. In 1965, "Setun" production was halted despite unfilled orders — and replaced with a binary machine of the same performance but 2.5 times more expensive. Reread that sentence. This is not a story about ternary losing to the market. This is a story about ternary losing to departmental logic — "not in the plan." A sad engineering conclusion: technical superiority doesn't penetrate bureaucratic armor if it lacks a lobbying machine behind it.
Brusentsov didn't give up. In 1970, at MSU they assembled "Setun 70" — not a modernization but a new machine: a tryte of 6 trits (~9.5 bits, fits both Cyrillic and Latin), stack architecture, single-wire ternary signal transmission instead of two-wire. The chief developer of software was Yevgeny Zhogolev. On "Setun 70," the team hardware-implemented Dijkstra's ideas about structured programming — what Dijkstra himself considered the unachieved "structural revolution" in the mainstream. The labor intensity of creating and modifying programs on a "procedural machine" dropped by 3–5 times. This gave rise to DSSP — the Dialogue System of Structured Programming, essentially emulating "Setun 70" architecture on ordinary binary computers. DSSP lives and evolves to this day — as does the ternary informatics laboratory at MSU's Faculty of Computational Mathematics and Cybernetics, active to this day. The "Mentor" teaching system created on "Setun 70" operated at MSU's VMK for decades afterward.
But "Setun 70" turned out to be the last ternary computer in history. After that — silence for half a century.
And here I move to what the whole investigation was started for. In February 2024, a group of Microsoft Research researchers (Ma, Wang, Wei, et al.) posts on arXiv a paper with a delightful title: "The Era of 1-bit LLMs: All Large Language Models are in 1.58 Bits". The gist: each neural network weight is replaced not with a 16-bit floating-point number, but with one of three digits: −1, 0, +1. This is exactly Brusentsov's balanced ternary code, only not in ferrite cores but in transformer weights. Where does "1.58" come from? It's log₂(3) ≈ 1.585 bits — the amount of binary information in one trit. The authors directly build their notation system on this number: BitNet b1.58.
Why does this matter? Full FP16 precision in large language models is mostly a transport tax: weights are distributed around zero, and most of them can be coarsened to three states with almost no quality loss. BitNet b1.58, with equal size and training volume, matches full-precision transformers on perplexity and task quality while winning on memory, latency, throughput, and — crucially — power consumption. In April 2025, the same group released BitNet b1.58 2B4T: the first open "natively" ternary model at 2 billion parameters, trained on 4 trillion tokens, with weights on Hugging Face and open-source inference for GPU and CPU. The paper honestly states: this is not just post-hoc quantization, this is a new scaling law — a scaling law for training future models, and "the door to hardware optimized for 1-bit LLMs."
And the hardware, by the way, is already knocking. In 2019, Professor Kyung Rok Kim's team from UNIST (South Korea), with Samsung support, published in Nature Electronics the first ternary CMOS technology on a full 8-inch wafer: the third signal level comes from the leakage current of an ordinary transistor — meaning a ternary chip on a standard binary fab, without manufacturing revolution. The authors reference the brain: it uses ternary synaptic weights and at peta-scale connectivity consumes about 20 watts. The target is not replacing Core or Ryzen, but ultra-energy-efficient accelerators for AI and edge devices where every watt counts. Funny: the business case for ternary logic that didn't exist in 1965 appeared in the 2020s — and it's again AI, only now not academic but market-driven, with real watt limits.
There's also a third, most botanical line: MSU's ternary informatics laboratory in the 2010s patented a ternary logic threshold element (PETL, patent RU № 2394366), implementable in ordinary semiconductor integrated circuitry — a direct functional analog of "Setun" elements, plus ternary adders, decoders, flip-flops, and the virtual ternary machine TVM with a ternary variant of DSSP. Quiet, almost invisible work continues from the 1950s — Brusentsov led it until his death in December 2014, living to 89.
So what happened? Ternary lost the battle of the 1960s — not because it was bad, but because binary transistors were simpler, and the inertia of technologies does the rest: colossal investments in binary silicon fabrication rolled over any theoretical advantage. But in three places ternary outlived its "defeat": in LLM weights (where "hardware" is a matrix of numbers, and transistor physics doesn't interfere), in energy-efficient chip research (where the logic itself saves energy), and in niches like number comparison, where a ternary comparator gives the answer "less/equal/greater" in one step instead of two. Plus delightful side quests: the ternary Thue sequence, which can grow infinitely without repeating subsequences (no such thing exists in binary — and this is, unexpectedly, also the problem of proper folder arrangement in a card catalog, where three-position tabs give eternal order without conflicts); the Erdős–Graham conjecture about powers of two in ternary notation, still open; and the Cantor set, which in the ternary system stops being a paradox and simply becomes "numbers without ones in their notation."
Conclusions:
My opinion, and it's a strong one: "Setun" is not a story about Soviet eccentricity. It's a story about how a mathematically optimal solution lost to a historically convenient one, and how the last word still went to mathematics — just with a 66-year delay and a different executor.
Three thoughts in closing.
First — about the cost of simplicity. The binary bit won not because binary is correct, but because a transistor with two states was the simplest realizable. This is a classic trap: local simplicity of an element bought at the price of global system suboptimality. We've been paying this rent for 70 years with every watt in data centers, and only the AI energy crisis forced engineers to open Pandora's box with three states. Knuth, who called balanced ternary "perhaps the prettiest number system of all," is still waiting for flip-flop to be replaced by flip-flap-flop — and it seems he got his wish, though not in the hardware he imagined.
Second — about Brusentsov's fate as a counterexample to the myth of "the impossibility of another path." He built a working serial ternary computer on scarce components, in the late 1950s, with the efforts of nine young people, and the machine worked without debugging from first power-on. What stood against him was not physics, but the planned economy and departmental skepticism. He lived until 2014 and until his last days worked at MSU on ternary logic — particularly on a three-valued generalization of Boolean algebra, where implication, besides "necessary" and "excluded," also has an honest "possible." A person who lived in the ternary world for 60 years while the entire rest of the world lived in binary — that's a separate genre of scientific stubbornness, and I tip my hat.
Third — the most ironic. Bitcoin mania trained the world on the word "quant," the AI boom on the word "bit." Yet meanwhile, the cheapest unit of information in approximate computation turned out to be not the bit, but the trit with states −1, 0, +1. Next time someone says "everything in the world is binary," suggest they analyze weights 1-3-9-27, calculate the cost r·w for bases 2 and 3, and then look at what weights make up Microsoft's freshly released model. Binary is not a law of nature. It's a colonial administration in the world of number systems, and its mandate, it seems, is finally beginning to expire.
History of "Setun" and "Setun 70" (primary sources from the developers themselves):
Mathematics of ternary:
Present day — AI and chips:
Context and current state: