-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcalibration.txt
More file actions
55 lines (31 loc) · 13.5 KB
/
Copy pathcalibration.txt
File metadata and controls
55 lines (31 loc) · 13.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
The history of computing reaches further back than is commonly understood. Long before silicon, humans built mechanical aids for arithmetic: the abacus, Napier's bones, the Pascaline, Babbage's Difference Engine. Each carried the same essential insight — that thought, or at least its mechanical shadow, could be embodied in a machine. The twentieth century inherited this idea and gave it electricity. Vacuum tubes, then transistors, then integrated circuits compressed thousands of mechanical operations into a square millimeter of silicon, and the programmable computer became less a mathematical curiosity and more a substrate on which civilization began to run.
Programming languages evolved in parallel. Assembly was a thin gloss over machine code; FORTRAN translated formulas into instructions; LISP gave us symbolic computation; ALGOL bequeathed structured programming to its descendants. C arrived in the early 1970s and refused to die, becoming the lingua franca of operating systems. Smalltalk made objects first-class. SQL declared what data we wanted instead of how to fetch it. By the time Python and JavaScript reached widespread adoption, the discipline had accreted decades of lessons about scope, types, abstraction, and the human mind's appetite for state.
Quantization in numerical computing is the act of mapping a continuous or high-precision value onto a coarser discrete grid. In digital signal processing, audio sampled at sixteen bits is quantized into one of sixty-five thousand levels, and the difference between the true analog signal and its representation is called quantization noise. The same idea, applied to the weight matrices of a large neural network, exchanges precision for memory and bandwidth: a model whose weights are stored in sixteen-bit floats can be re-expressed in four bits, or three, or two, or fewer, often with surprisingly little loss in capability. The trick is to spend the bits where they matter — where small numerical perturbations cause large behavioral changes — and to spend fewer bits elsewhere.
The importance matrix, or imatrix, is the bookkeeping device that makes such selective quantization possible. To compute it, the model is run over a representative corpus of text, and the activations passing through each weight are observed. Weights that participate in producing large, frequent activations contribute more to the model's output and are therefore more sensitive to error; weights that lie quietly in seldom-trodden corners can absorb more noise. The imatrix records this sensitivity per parameter, and the quantizer uses it to allocate its limited bit budget where it does the most good.
A short story. Anya watched the snow gather on the windowsill of the train as it pulled into Tartu, and she remembered her grandmother's apartment, the one with the green carpet and the smell of dill. She had not been back in nine years. The taxi driver said something she did not catch, and she nodded automatically, the way she had learned to do in countries whose languages she did not speak. The driver laughed gently, then repeated himself in English. "First time?" he asked. She said no, but it had been a long time. He nodded as if this explained everything.
A scene of dialogue. "You can't just rewrite the kernel," said Theo, leaning back in his chair until the front legs lifted off the floor. "We don't have time." "I'm not rewriting the kernel," Mira answered, without looking up. "I'm replacing the scheduler. Different problem." "Same blast radius." "Not really. The scheduler interface is documented; the kernel API is whatever Linus felt like that morning." Theo made a noise halfway between a laugh and a sigh, and Mira finally turned to face him. "Look. If you want to ship in May, we either fix this or we accept the latency tail. Pick one."
Mathematics. Let f be a real-valued function defined on the closed interval [a, b]. We say f is uniformly continuous on [a, b] if for every epsilon greater than zero there exists a delta greater than zero such that for any two points x and y in [a, b] with the absolute value of x minus y less than delta, the absolute value of f of x minus f of y is less than epsilon. The Heine–Cantor theorem states that every continuous function on a compact metric space is uniformly continuous, a result whose proof rests on the finite subcover property of compactness and which is foundational to much of analysis.
A recipe. To make a simple loaf of country bread, combine four hundred grams of bread flour, one hundred grams of whole wheat flour, ten grams of salt, and three hundred and fifty grams of water at room temperature. Knead until the dough passes the windowpane test, about ten minutes by hand. Allow to rise at warm room temperature for two hours, folding the dough every thirty minutes. Shape into a round and place into a floured banneton; rest in the refrigerator overnight. The next morning, preheat a Dutch oven to two hundred fifty degrees Celsius. Score the loaf, bake covered for twenty minutes, then uncovered for another twenty-five.
Code. The Fibonacci sequence is defined by F(0) = 0, F(1) = 1, and F(n) = F(n - 1) + F(n - 2) for n greater than or equal to two. A naive recursive implementation has exponential running time because it recomputes the same subproblems many times. A linear-time implementation walks from zero up to n, keeping only the last two values in memory.
```python
def fib(n: int) -> int:
a, b = 0, 1
for _ in range(n):
a, b = b, a + b
return a
```
The same idea in C might use a pair of unsigned long long variables and a for-loop; in Haskell it could be expressed with zipWith and lazy evaluation, defining the entire sequence as a list and indexing into it; in APL it could be reduced to a few characters.
Geography. The Caspian Sea is the largest enclosed body of water on Earth by area, bordered by Russia, Kazakhstan, Turkmenistan, Iran, and Azerbaijan. Its surface lies twenty-eight meters below sea level. The Volga, Europe's longest river, drains into it from the north. The sea is ancient — geologists trace it to the Paratethys, a Cenozoic remnant of the Tethys Ocean — and its waters are saline but considerably less so than ocean water. It hosts seals, sturgeon, and a uniquely adapted ecosystem now under increasing pressure from oil extraction and fluctuating water levels.
Music. The major scale is built from a specific pattern of whole steps and half steps: whole, whole, half, whole, whole, whole, half. Starting on C and moving up the white keys of a piano produces this pattern naturally. The seven modes of the major scale rotate the starting point, producing Ionian, Dorian, Phrygian, Lydian, Mixolydian, Aeolian, and Locrian, each with its own characteristic flavor. Dorian, with its raised sixth against a minor tonic, suggests folk and modal jazz; Phrygian, with its lowered second, evokes Spanish flamenco; Lydian, with its raised fourth, has been favored by film composers for its quality of unresolved aspiration.
Biology. The mitochondrion is a double-membraned organelle found in nearly all eukaryotic cells. It is the site of oxidative phosphorylation, the process by which the chemical energy stored in nutrients is converted into adenosine triphosphate. Mitochondria carry their own circular DNA, distinct from the nuclear genome, and reproduce by a process resembling binary fission. The endosymbiotic theory holds that mitochondria descend from a free-living bacterium engulfed by an early eukaryotic ancestor, and the genetic and structural evidence for this hypothesis is now overwhelming.
Philosophy. Wittgenstein, in the closing pages of the Tractatus, wrote that whereof one cannot speak, thereof one must be silent. He later came to regard the Tractatus as deeply mistaken, replacing its picture theory of meaning with the idea that the meaning of a word is its use in a language game. The shift from the early to the late Wittgenstein parallels a broader twentieth-century turn from formal to ordinary-language analysis, from the search for the structure of the world to the description of the structure of our talk about it.
Sports. In tennis, the second serve is the safety net beneath the first. A player who hits a fault on the first serve must, on the second attempt, balance aggression against the cost of a double fault, which surrenders the point outright. Statistical studies of professional tennis show that points won on the second serve are among the strongest predictors of overall match outcome, and that the gap between elite players is more visible there than on the showy first-serve aces.
Astronomy. Stars form when interstellar clouds of hydrogen and helium collapse under their own gravity. As the gas contracts, its temperature rises until hydrogen fusion ignites in the core, balancing gravity with radiation pressure. Stars with masses between roughly half and eight solar masses end their lives as white dwarfs after a phase of expansion into red giants and the ejection of their outer layers as planetary nebulae. More massive stars exhaust the nuclear fuel chain to iron, collapse catastrophically, and explode as supernovae, leaving behind neutron stars or, above a critical mass, black holes.
Engineering. The bridge across the strait was designed to flex by as much as two meters in the strongest winds and to settle no more than fifteen millimeters per year as its piers consolidated into the marine clay below. Each cable was made of more than thirty thousand wires, each wire about five millimeters in diameter, spun in place between the towers and bound into a single hexagonal bundle. The deck was assembled from prefabricated steel boxes, lifted into place by gantries and welded shut from the inside. The whole structure carries the load of its own weight, the variable load of vehicles, and the dynamic load of wind, and it does so by distributing every force into tension in the cables and compression in the towers.
Dialogue, technical. "Why is this query slow?" "It's doing a sequential scan." "On a fifty-million-row table?" "On a fifty-million-row table." "Why isn't it using the index?" "Because the planner thinks the predicate matches more rows than it does. The statistics are stale." "How stale?" "We last analyzed in February." "Run analyze. Then run it again every Sunday. Add it to cron." "On the replica?" "On all of them."
Cooking, with measurements. Thirty grams of olive oil, two cloves of garlic minced, one pound of fresh tomatoes peeled and chopped, a pinch of salt, a leaf of basil. Heat the oil over medium heat. When it shimmers but before it smokes, add the garlic and stir for fifteen seconds. Add the tomatoes and a pinch of salt and let them collapse for ten minutes. Tear the basil in at the very end. Toss with one pound of pasta cooked one minute shy of the package directions, with a quarter cup of the pasta water reserved.
History. The Library of Alexandria, founded in the third century before the common era under the Ptolemaic dynasty, attempted something ambitious and probably impossible: to collect every book in the known world. Its true size is contested by historians, with estimates ranging from forty thousand to seven hundred thousand scrolls. Its destruction is also contested; popular accounts blame Caesar's fire of forty-eight before the common era, others the Christian riots of three ninety-one, others still the Muslim conquest of the seventh century. The truth is most likely a slow attrition rather than a single catastrophe — a gradual loss of the institutional support, scholarly community, and economic conditions under which a library can function.
Linguistics. English borrowed massively from Norman French after ten sixty-six, with the result that for many concepts the language has paired Germanic and Romance vocabulary at different registers — cow against beef, pig against pork, house against mansion, ask against inquire. The Germanic words tend to be concrete, short, and associated with everyday speech; the Romance imports tend to be more abstract, longer, and bear a faint air of formality. Stylists exploit this contrast deliberately, choosing the plainer or fancier word according to the texture they want their prose to have.
Probability. The expected value of a random variable is the long-run average of its outcomes weighted by their probabilities. For a fair six-sided die, the expected value of a single roll is three and a half. The Law of Large Numbers guarantees that the empirical mean of independent identically distributed samples converges in probability to the true expected value, and the Central Limit Theorem describes the rate and shape of that convergence. Together these results form the backbone of statistical inference and explain why intuitions about randomness so often fail at small sample sizes.
Travel. The road from Reykjavik to Akureyri is six and a half hours of two-lane highway through lava fields, glacier rivers, sheep, and wind. There is a single tunnel under a fjord, with a toll booth at the entrance; otherwise the road simply traces the coast. The light in October falls flat across the volcanic rock and the moss looks like green velvet stretched over broken glass. Stop at Hvammstangi for fuel and a coffee, even if you don't need either.
Closing. We have wandered through history, mathematics, fiction, recipe, and code. The point of this corpus is not to be read but to be passed through a model so that the activations of every layer can be observed; the importance matrix is the residue. Whatever you find here that surprises you is, in some small measure, what the model considers important — what it has learned to attend to — and the bits we save in quantization are the bits we choose not to care about. Choose carefully.