Get Started
Home
Topics
Search
Library
7 min read · Mechanistic Interpretability · Reasoning · Added Oct 2 · Paper published Sep 26, 2026

LANTERN: Illuminating Hidden Mathematical Knowledge in Language Models

Source: research paper via Hugging Face Daily Papers
Lantern ranks pairs of OEIS sequences by what a pretrained LLM’s hidden-layer activations say about their relatedness, surfacing four previously-unrecorded mathematical connections in under 8 hours. The trick that matters: grading training links by substance (gold/silver/trivia) before fitting the probe lifted verified hits from 3 to 44.

TL;DR

Lantern ranks pairs of mathematical objects in a knowledge base by what a pretrained LLM’s hidden states say about them, surfacing four previously-undocumented relations between OEIS sequences in under 8 hours of compute.

Why It Matters

AI systems can now prove olympiad problems and resolve open conjectures, but a human still has to decide which questions are worth asking. That bottleneck matters because mathematical knowledge bases contain many objects whose connections nobody has noticed: the OEIS alone has about 400,000 entries, each a sequence of integers, with human-curated cross-references recording known relations.
Prior approaches to this “what to study” problem either mine open problems from existing papers, score missing edges in a knowledge graph by graph topology (closest in spirit is HyGRAIL, which does this for materials science), or have a model generate conjectures and filter them. The authors try something different: they assume a pretrained LLM already encodes, in its activations, latent knowledge about which mathematical objects are related, and that this knowledge can be read out directly.

How It Works

The idea is that two sequences the model “thinks about similarly” at some layer are candidates for being mathematically related, even when no cross-reference records it. The pipeline turns this into a search.
First, embed each sequence’s one-line definition with Qwen3-32B and keep the mean activation at every layer (65 layers for Qwen3-32B). For a pair of sequences, build a feature vector: centered cosine similarity at each layer (subtracting each sequence’s typical similarity to a random sample, so that “popular” sequences don’t dominate) plus element-wise products and absolute differences of PCA-reduced activations at two layers. A logistic regression on these ~321 features is trained on human cross-references as labels.
Crucially, the labels are graded, not raw. A screening model (Claude Sonnet 5) read each existing cross-reference and marked it gold (theorem-grade identity), silver (textbook routine), or trivia (same object relabeled, rescaled). Only gold and silver count as positives; trivia and random unlinked pairs are negatives. Without this grading, the classifier mostly learns to spot trivial links.
The classifier scores all 50 million pairs among the 10,000 most-referenced sequences. The top of the ranking goes through a cheap LLM filter (Claude Sonnet 5, no tools, asked only whether an exact relation plausibly exists), then a stronger agent (Claude Opus 5 with a sandbox and a local OEIS mirror) proposes an exact Python function computing one sequence from the other, plus a human-readable derivation. Finally, every proposal is checked against every stored term of the target sequence, and the derivation is read analytically.
for pair in rank_by_classifier(all_50M_pairs)[:500]: if not cheap_filter_llm(pair): # Claude Sonnet 5 continue hypothesis = agent_propose(pair) # Claude Opus 5 + sandbox if hypothesis is None: continue if matches_all_stored_terms(hypothesis) and derivation_checks_out(hypothesis): yield hypothesis

What They Found

The end-to-end pipeline (classifier training, scoring 50M pairs, filtering, agent proposals, verification) ran in under 8 hours. From 500 top-ranked candidates in the main configuration, 118 passed the cheap filter, 44 received a hypothesis from the agent, and all 44 passed sandbox and analytical verification. Pooling three search configurations gave 62 technically verified relations between pairs the OEIS does not cross-reference.
Technical verification isn’t the real bar: a relation can reproduce every stored term while being mathematically empty (a reindexing, a change of normalization, a universal reconstruction recipe). A separate content screen retained 13 relations; of these, nine were informative or insightful, and four were not found in the OEIS or in a targeted literature search. Two of those four are structural bridges across mathematical domains: one links one-dimensional and two-dimensional cellular automata (Rule 150 and the Fredkin replicator) via a difference-of-squares identity on binary-run block factors; the other shows a product of a Rogers-Ramanujan continued fraction with a theta quotient equals the generating function counting 5-core partitions.
Three controls try to rule out explanations other than “the model’s representations carry mathematical knowledge.” (1) A surface-text scorer, trained on the same labels using character n-gram features, is at chance (AUC 0.51) on held-out cross-references when evaluated against topic-matched negatives, while the activation classifier reaches 0.57–0.58. (2) On 2,379 entries created after the model’s knowledge cutoff, the classifier reaches AUC 0.88 versus 0.89 on an in-distribution split, so page memorization isn’t necessary. (3) Asking the model directly to rate the depth of a relation on a 0–9 scale (using the token-logit expected value) ranks held-out substantive pairs about as well as the trained classifier (median percentile 88.5 vs 88.0). The authors read this as evidence that the signal is latent knowledge, not an artifact of their labels.

What’s Useful

If you maintain or work with a structured knowledge base where objects have canonical definitions and existing links encode known relations (not just OEIS, think materials graphs, chemistry databases, formal libraries), the recipe is testable: embed each object, train a pairwise classifier on human-curated “interesting” links, rank all pairs, then put an LLM agent plus a cheap verifier on the top of the ranking. The prerequisite that changes the advice: you need cheap, exact verification. OEIS gives this for free because every sequence stores its terms. Without an analog, the agent stage balloons in cost and the “technically verified” bar collapses.
The graded labeling step is worth copying even if you don’t use the rest. Training on raw “linked vs. not linked” (variant 1) produced only 3 verified relations from its first 100 pairs; training on graded labels (variant 2, main) produced 15 and 44. If your knowledge base’s links are a mix of substantive and bookkeeping, pay an LLM to triage them before training anything.
Two cautions on scope. The classifier gets you a ranked candidate list, not a theorem. The expensive, load-bearing work is still the agent proposing a derivation and the human-readable check: of 62 technically verified outputs, the content screen rejected 49 as definitional, representational, or mechanically reproducible, and only four counted as genuinely novel after literature search. The label-free direct-question control is interesting on its own, worth testing: if you only need to rank a few thousand candidates, asking the model directly may be competitive with training a probe, at much higher per-pair cost.

Caveats

The test bed is unusually favorable. OEIS entries have formal definitions, stored terms for cheap first-pass verification, and a decades-old link graph to supervise on. The authors flag that it’s unclear whether the approach transfers to less formal mathematical objects or knowledge bases without explicit link records. The corpus is also biased toward frequently-referenced sequences, which are the ones most likely to have been well-represented in pretraining.
Only one model family (Qwen3) was tested, across three sizes. The surface-text baseline isn’t completely dominated: on the popularity-matched exam without topic matching, a boosted text scorer reaches the 90th percentile, close to the activation classifier, because many “substantive” held-out pairs are instances of a few templates. The gap between activations and text widens specifically under topic-matched evaluation, which is the fairer test.
“N2” (not found in literature search) is not a priority claim. Four of the nine informative/insightful relations were not found by the authors’ searches, but the paper is careful that this doesn’t establish the underlying identities are new theorems, only that the connection between those two OEIS entries wasn’t previously recorded in a place they could find. Finally, all 62 derivations were produced by an LLM and the paper states explicitly they have not been checked by a human mathematician.
Topics
Mechanistic Interpretability
Reasoning
NLP
Mechanistic Interpretability
Reasoning
NLP
Up next in Mechanistic Interpretability
Execution Before Memory: Diagnosing Memory Failures in Video World Models
Lexical Reference Frames: Interpreting LM Residual Streams in Native Semantics
Don't miss new content
Log in to follow topics and personalize your feed.
Related topics you might like
Mechanistic Interpretability36 episodes
Reasoning147 episodes
NLP145 episodes