Manuscript Offprint
arXiv:2609.10305RiLM: Parameter-Efficient Language Modeling via Geodesic Decoding
Fang Li
Department of Computer Science Oklahoma Christian University Edmond, USA Email: fang.li@oc.edu
Abstract—Language models under one million parameters matter for edge deployment, domain adaptation, and reproducible research, yet a two-layer LSTM or Transformer at embedding width still spends roughly one third of its capacity on the output matrix . We propose Riemannian Language Models (RiLM), which remove that layer entirely: context unfolds as a trajectory on a Riemannian manifold, and next-token probabilities arise from squared geodesic distance between the current state and vocabulary embeddings. The same embedding map serves input and output—decoding is geometry. We instantiate the framework on flat (Flat RiLM) and the Poincaré ball (HypRiLM) with a shared MLP composition map parameters, . Across five seeds on WikiText-2, HypRiLM reaches validation perplexity versus for Flat RiLM; tied and matched LSTM, Transformer, and SSM controls remain at 113-147 PPL on WT-2—HypRiLM leads by roughly over the strongest tied recurrent baseline (SSM, ). Penn Treebank and a 10k-vocabulary stress test confirm that geodesic decoding transfers across corpora and larger , while hyperbolic curvature helps selectively. We also characterize boundary collapse in naive hyperbolic recurrence and show how Möbius stabilization restores trainability. Claims are scoped to controlled small-model comparisons, not full-vocabulary state of the art.
Index Terms—language modeling, Riemannian geometry, hyperbolic neural networks, parameter efficiency
I. INTRODUCTION
Neural language models map token sequences to distributions over the next word. The dominant recipe—token vectors in , state updates via LSTM gating [1] or self-attention [2], and an affine readout —scales to billions of parameters and underpins systems from machine translation to code generation [3], [4]. That recipe is the right default when compute and data are abundant. It is a poor default when the model must fit on device, adapt quickly to a narrow domain, or serve as a reproducible scientific instrument: below one million parameters, can consume one third of the budget at and , matching the embedding table. Shrinking to compensate weakens the recurrent or attention core; enlarging without enlarging the model makes the output layer dominate entirely. Tied embeddings [5] halve redundant rows but still decode via a linear functional detached from how states move through representation space.
Language also carries hierarchical structure—syntax, lexical relations, topical organization—that Euclidean space embeds with distortion that grows in depth [6]. Hyperbolic space offers exponentially growing volume and has improved static embeddings and feed-forward layers [7], yet it is rarely used to govern how context is composed step by step. We ask whether manifold geometry can replace not only word vectors but the decoder itself.
We introduce Riemannian Language Models (RiLM). The state lives on a Riemannian manifold . A single map , shared at every timestep, reads the current state and incoming token and proposes a tangent direction; the state then moves along the corresponding geodesic. Decoding needs no : word is likely when its embedding lies close to in geodesic distance, . Context becomes a trajectory ; classification and representation are coupled because the model must arrange vocabulary points so that plausible continuations lie near that trajectory.
We study two instantiations: Flat RiLM on (the Euclidean special case of our earlier unpublished prototype) and HypRiLM on the Poincaré ball . Hyperbolic recurrence posed an unexpected obstacle—naive exponential-map updates drive states to the ball boundary and flatten all logits—which we analyze and resolve with Möbius translation (Section V). Empirically, we report multi-seed WikiText-2 and Penn Treebank results against untied, tied, and matched-parameter LSTM, Transformer, and selective state-space baselines. HypRiLM improves relative to Flat RiLM on web text and trails Flat RiLM on newswire PTB; on both corpora, each RiLM variant beats matched and tied LSTM, Transformer, and SSM controls by wide margins (Tables IV and VI). We do not target billion-parameter pretraining; the contribution is a geometric language-modeling template, a trainability analysis for hyperbolic recurrence, and evidence that decoding geometry matters when parameters are scarce.
Contributions. This paper makes four claims, each backed by controlled experiments at parameters. First, geodesic decoding replaces with distance to vocabulary points on , coupling representation and classification without a separate readout layer. Second, the same template instantiated flat and hyperbolic sequential models, enabling a direct test of whether curvature helps composition when is held fixed. Third, we identify boundary collapse in naive hyperbolic recurrence—a failure mode that drives perplexity to the uniform baseline—and show that Möbius-based updates restore stable training. Fourth, under explicit fairness protocols (tied and matched baselines, including a modern SSM control), both RiLM variants outperform LSTM, Transformer, and SSM decoders on WikiText-2 and Penn Treebank by margins that tied embeddings alone do not explain.
Scope and organization. Our primary evaluation uses the 2000 most frequent words on WikiText-2 and PTB so that accounts for a transparent 256k parameters at d=128; we do not claim numerically comparable perplexity to full-vocabulary leaderboard models. Section III defines RiLM; Section IV presents multi-seed results, vocabulary scaling, ablations, and geometry analysis; Section V interprets boundary collapse, when curvature helps, and limitations.
Hyperbolic representation learning. Hyperbolic space embeds trees and hierarchies with low distortion [6]; hyperbolic neural networks provide Möbius operations and Riemannian optimization tools [7]. Most prior work applies hyperbolicity to static objects—word vectors, graph nodes, or single feedforward layers. RiLM asks whether curvature should govern the trajectory of context: each token applies the same and moves the state along a geodesic, and every prediction step reuses the same distance-based readout. The sequential, recurrent use of hyperbolic geometry is therefore qualitatively different from Poincaré word embeddings with a Euclidean softmax on top.
Efficiency and modern recurrent baselines. Parameter-efficient fine-tuning (e.g., LoRA [9]) reduces adaptation cost but leaves the pretrained decoder intact. Continuous-time models [10] and volume-preserving flows [11] study dynamics but do not remove vocabulary-sized output layers in small LMs. Selective state-space models [12] offer linear-time recurrence with input-dependent gating and represent the strongest modern alternative to LSTM/Transformer backbones at similar width. We implement a lightweight diagonal SSM as an additional baseline; RiLM competes on decoding geometry rather than on replacing with a different recurrent operator.
III. METHOD
RiLM treats a sentence as motion on a manifold: each token nudges the state along a learned geodesic, and the next-word distribution is read off from geometry rather than a separate classifier. Figure 1 summarizes one timestep. The design deliberately mirrors tied embeddings—input and output share parameters—but replaces the linear map with negative squared distance , so the model must organize vocabulary points on M in a way that supports both ingestion and prediction.
A. Geometric Background
A Riemannian manifold equips each tangent space with an inner product varying smoothly in . The exponential map sends tangent vector along the geodesic starting at in direction ; the logarithmic map inverts it locally. Geodesic distance is the length of the shortest path on . On , and .
The Poincaré ball models hyperbolic space with curvature . The conformal factor diverges at the boundary, yielding exponential volume growth . Möbius addition [7],
is closed on the open ball. Hyperbolic distance is .
B. Recurrence and Geodesic Decoding
Given vocabulary , each word has embedding and the contextual state summarizes prefix . A shared composition map reads tangent coordinates at the origin and proposes an update direction:
Decoding with temperature defines a softmax over negative squared distances,
which is analogous to metric learning: likely words are those whose embeddings lie in a small geodesic ball around . The softmax can be viewed as a kernel classifier with ; on this resembles a Gaussian RBF over embedding space, while on distances grow faster with separation, sharpening the effective decision boundary near the state trajectory. Unlike a free linear head , the classifier weights are identified with vocabulary geometry—the model cannot assign high probability to a word without placing near regions of that actually visits.
On , identifying tangent vectors with ambient coordinates , Eq. (2) reduces to additive composition —the Euclidean special case of our unpublished flat prototype (anonymous supplementary

Fig. 1. RiLM at timestep : shared , geodesic state update, and distance-based decoding without .
code). The sequence starts from with learned .
C. Hyperbolic RiLM and Möbius Recurrence
Eq. (2) is the natural hyperbolic analogue of additive recurrence, but implementing directly on fails in practice. As , the conformal factor diverges: small tangent steps at correspond to enormous boundary motion, states stick to the ball boundary, and becomes nearly constant for all . We observed within three steps and validation perplexity equal to (Section V).
Our fix computes increments where the metric is well-behaved—at the origin—and transports them with Möbius addition:
with learnable step scale initialized near . After training on WikiText-2, on held-out prefixes typically lies in —well inside the ball (Figure 3). Embeddings and are projected to ; projecting after every step stalled optimization at PPL, so we project only static parameters.
D. Composition Function and Training
We use a single MLP for in all main experiments: with parameters at ), shared across timesteps. Sharing is central to the RiLM hypothesis: composition rules should not proliferate with sequence length the way layer-specific attention maps do. The model minimizes masked token negative log-likelihood,
with padding mask . Long compositions are trained with truncated BPTT (): states detach every steps, limiting gradient depth through repeated while matching the effective update frequency of windowed baseline training. At and context 64, each token still participates in eight compositional steps before gradients truncate—comparable to the receptive field of a shallow LSTM unrolled over the same window. Under this parameter budget, most predictive signal appears local: extending context to 256 with
TABLE I PARAMETER ALLOCATION (, ).
| Component | RiLM | LSTM | Transformer |
|---|---|---|---|
| Embeddings | 256k | 256k | 256k |
| Output head | 0 | 256k | 256k |
| Composition core | 33k | 264k | 265k |
| Total | 289k | 776k | 777k |
TABLE II SHARED HYPERPARAMETERS.
| Setting | Value |
|---|---|
| Embedding / vocab. | 128 / 2000 (most frequent) |
| Context length / TBPTT | 64 / 8 |
| Batch size / epochs | 128 / 10 |
| Decoding temperature | 1.0 |
| Flat / LSTM / TX learning rate | |
| HypRiLM learning rate | |
| SSM learning rate | |
| LSTM / Transformer | 2 layers; TX: 4 heads, FFN 256 |
| WT-2 seeds / PTB seeds | {42, ..., 46} / {42, 43, 44} |
spline regresses to 65.6 PPL (Table VII), so main experiments keep context 64 and MLP . Flat RiLM uses Adam at ; HypRiLM uses , curvature , embedding initialization , and gradient clipping at norm 1.0. All models train for 10 epochs with batch size 128 and context length 64 (Table II). Volume-preserving word flows are possible in principle [11]; our MLP does not satisfy this, and spline variants (Table VII) move perplexity only slightly—suggesting that gains come from decoding geometry and manifold choice rather than from entropy-preserving dynamics alone.
E. Parameter Budget and Baseline Fairness
At and , geodesic decoding eliminates the parameters that LSTM and Transformer decoders allocate to (Table I). RiLM reinvests that capacity in full-width embeddings and . Fair comparison therefore requires two baseline regimes. Tied models at share input/output embeddings like RiLM but retain flat LSTM, attention, or SSM dynamics. Matched models equalize total parameters at by shrinking hidden width to , which weakens their recurrent core. Tied rows are the stronger control on decoding; matched rows isolate whether RiLM wins only because it keeps .
IV. EXPERIMENTS
We designed experiments to answer three questions. Q1: Does geodesic decoding improve language modeling when decoder capacity is fairly counted against LSTM, Transformer, and SSM baselines? Q2: Holding fixed, does hyperbolic curvature improve over flat space? Q3: Do relative conclusions survive a tenfold increase in ? We report validation perplexity on WikiText-2 (WT-2; full train/validation
TABLE III WIKIText-2 VALIDATION PERPLEXITY (FIVE SEEDS, 2K VOCAB).
| Model | PPL ↓ | Params |
|---|---|---|
| HypRiLM (MLP ) | 289k | |
| Flat RiLM (MLP ) | 289k | |
| LSTM, untied | 776k | |
| Transformer, untied | 777k |
splits, 2.1M training tokens) and the Zaremba Penn Treebank (PTB; 887k training tokens). Primary tables use the 2000 most frequent words on both corpora. This protocol fixes so that costs 256k parameters at , making the trade-off in Table I explicit. Absolute perplexities are not comparable to full-vocabulary leaderboard entries (Table VIII); our claims concern controlled comparisons at matched scale.
Baselines and training protocol. We compare against two-layer LSTM, two-layer causal Transformer (four heads, FFN width 256), and a selective diagonal SSM inspired by Mamba [12]—each in untied, tied [5], and matched (290k) regimes. SSM uses Adam at and reports the best validation checkpoint within 10 epochs (it overfits after 4 epochs on WT-2); Flat RiLM, LSTM, and Transformer use ; HypRiLM uses . All non-SSM models use the final epoch checkpoint. WikiText-2 aggregates mean std over five seeds ; PTB over three seeds . Effect sizes on WT-2 are large: the HypRiLM–Flat gap (33 PPL) exceeds the HypRiLM standard deviation (0.2), and HypRiLM–SSM-tied gaps (59 PPL) exceed the SSM-tied std (3.8). Reported means std over seeds therefore suffice; formal significance tests add little beyond these intervals. All training uses one GPU; reproduction scripts and unit tests for hyperbolic primitives are in anonymous supplementary material.
A. WikiText-2 at Controlled Vocabulary
Table III reports headline WT-2 results. HypRiLM reaches perplexity at 289k parameters—the best result by a wide margin, with standard deviation far smaller than the gaps to baselines. Flat RiLM attains with the same and parameter count, isolating curvature: hyperbolic space accounts for a 38% relative improvement on this corpus. Untied LSTM () and Transformer () use 776k parameters yet remain 84–96 PPL worse, indicating that adding capacity does not close the gap when the compositional core stays flat and Euclidean.
Fair comparisons in Table IV address whether RiLM wins only by tying or by parameter accounting. Against tied LSTM (), Transformer-tied (), and SSM-tied ()—all at with shared input/output weights—HypRiLM still leads by 59–93 PPL while using fewer parameters than the LSTM and Transformer rows. The SSM-tied row is particularly informative: it is a modern recurrent decoder with selective gating, yet remains worse than HypRiLM (113.0 vs. 54.2). Against matched baselines at
TABLE IV FAIR WIKIText-2 COMPARISON (FIVE SEEDS ; ALL MODELS). PRIMARY CONTROLS: TIED AND MATCHED ROWS.
| Model | PPL ↓ | Params |
|---|---|---|
| HypRiLM | 289k | |
| Flat RiLM | 289k | |
| LSTM-tied () | 520k | |
| LSTM-matched | 273k | |
| Transformer-tied () | 521k | |
| Transformer-matched | 283k | |
| SSM-tied () | 374k | |
| SSM-matched | 271k |
290k total, hidden widths shrink to –97; HypRiLM wins by 64–89 PPL while retaining . No fair regime reverses the ranking.
On a small held-out subset (10k training / 500 validation tokens; seed 42), model ordering matches Table III (HypRiLM 76.4, Flat RiLM 103.0, LSTM 189.0, Transformer 148.5 PPL). Ablating the Möbius fix—using directly in Eq. (2)—drives perplexity to the uniform baseline (Table IX), confirming that trainable hyperbolic dynamics are prerequisite to the headline results.
B. Vocabulary Scaling to
When grows tenfold, embedding tables dominate parameter count (1.3M for RiLM at ) and the original 290k matched baselines are no longer meaningful—shrinking to match budget would yield . We therefore compare RiLM variants and tied baselines at full width with batch size 32 (Table V). Absolute perplexity rises and is not comparable to Table III; the question is whether ranking persists.
Both RiLM variants remain far below SSM-tied (): Flat RiLM at , HypRiLM at . Flat RiLM is marginally best on mean; HypRiLM is competitive but seed 44 is an outlier (368.4 PPL), inflating variance. We interpret this as evidence that (i) geodesic decoding remains advantageous at larger , but (ii) hyperbolic curvature is not uniformly superior—on this scale, Euclidean geometry is slightly more stable. Tied LSTM and Transformer runs were unstable under the shared 10-epoch schedule (PPL ), highlighting optimization fragility of flat decoders at large under matched training budgets; SSM-tied is the reliable recurrent control here.
C. Penn Treebank and Cross-Corpus Behavior
PTB reverses the within-family WT-2 ordering: Flat RiLM () beats HypRiLM () at identical 289k parameters (Table VI). Against fair baselines, both variants remain far below tied LSTM (), Transformer-tied (), and SSM-tied (), as well as matched LSTM (), Transformer (), and SSM () controls. Geodesic decoding therefore transfers across corpora even when negative curvature is not the right inductive bias. PTB is smaller and stylistically homogeneous
TABLE V
WIKITEXT-2 at 10K VOCABULARY (d=128, THREE SEEDS).
| Model | PPL ↓ | Params |
|---|---|---|
| HypRiLM | 345.8 ± 16.0 | ~1.31M |
| Flat RiLM | 341.8 ± 0.5 | ~1.31M |
| SSM-tied (d=128) | 708.3 ± 9.0 | ~1.38M |
| LSTM-tied (d=128)† | 2021 ± 135 | ~1.54M |
| Transformer-tied (d=128)† | 1513 ± 116 | ~1.52M |
†Unstable under identical training at .
TABLE VI
PENN TREEBANK VALIDATION PERPLEXITY (THREE SEEDS, 2K VOCAB; TIED AND MATCHED BASELINES).
| Model | PPL ↓ | Params |
|---|---|---|
| Flat RiLM | 40.9 ± 0.6 | 289k |
| HypRiLM | 69.8 ± 0.5 | 289k |
| LSTM-tied (d=128) | 214.3 ± 11.3 | 520k |
| LSTM-matched | 161.6 ± 1.6 | 273k |
| Transformer-tied (d=128) | 182.3 ± 1.2 | 521k |
| Transformer-matched | 171.4 ± 4.1 | 283k |
| SSM-tied (d=128) | 108.9 ± 23.7 | 374k |
| SSM-matched | 149.3 ± 27.3 | 271k |
(newswire); WT-2 is noisier web text with broader topical structure. We report both corpora so readers can judge when to prefer Flat vs. HypRiLM rather than treating hyperbolicity as a universal upgrade.
D. Ablations and Literature Context
Table VII disentangles architectural choices on WT-2 (seed 42). Replacing MLP with monotone spline compose nodes (8 knots) improves Flat RiLM by ~4.4 PPL but changes HypRiLM by only ~0.1 PPL—smaller shifts than the ~34 PPL gap between hyperbolic and flat MLP rows. Reducing curvature to degrades HypRiLM from 54.0 to 71.1 PPL, confirming that the ball's negative curvature is doing work, not merely adding parameters. Extending context to 256 with spline yields 65.6 PPL, so we retain context 64 and MLP in all headline runs.
Table VIII places our seed-42 numbers beside published full-vocabulary models for context only. Transformer-XL, GPT-2, and AWD-LSTM operate at 33M–257M parameters with extensive regularization; HypRiLM uses 2k words and ~289k parameters. The numeric proximity of HypRiLM (54.0) to AWD-LSTM (60.7) is not a controlled comparison and should not be read as competitive SOTA; it illustrates how controlled-vocabulary perplexity can look deceptively strong relative to leaderboard entries.
E. Learned Geometry and Training Dynamics
Quantitative perplexity alone does not show whether geodesic decoding organizes representation space. We therefore inspect trained HypRiLM and Flat RiLM models (WT-2, seed 42, 10 epochs) on a held-out validation prefix.
TABLE VII
WIKITEXT-2 ABLATIONS (SEED 42).
| Variant | Manifold | PPL ↓ |
|---|---|---|
| MLP (default) | , | 54.0 |
| MLP (default) | 88.1 | |
| Spline 1D (8 knots) | 53.9 | |
| Spline 1D (8 knots) | 83.7 | |
| MLP, | 71.1 | |
| Spline , context 256 | 65.6 |
TABLE VIII
WIKITEXT-2 PERPLEXITY IN THE LITERATURE (TOKEN-LEVEL; NOT COMPARABLE TO OUR 2K-VOCAB SETUP).
| Model | PPL ↓ | Params |
|---|---|---|
| Transformer-XL [4] | 23.1 | 257M |
| GPT-2 small [3] | 29.4 | 117M |
| AWD-LSTM [8] | 60.7 | 33M |
| HypRiLM (ours, seed 42) | 54.0 | 289k |
| Flat RiLM (ours, seed 42) | 88.1 | 289k |
Training stability. Figure 2 tracks validation perplexity when the hyperbolic recurrence uses naive updates versus the Möbius fix (Eq. (4)). Naive training remains near ~150 PPL across 10 epochs; Möbius HypRiLM improves monotonically to ~54—the same regime as Table III. The forward-pass collapse in Table IX (, PPL = ) explains why naive training fails to descend; Möbius transport is required for usable hyperbolic dynamics.
Trajectory and ball geometry. Figure 3 visualizes a 20-token prefix. Panels (a–b) project vocabulary embeddings (gray) and the state trajectory (colored path; green/red: start/end) via PCA; the dashed circle in (a) is the Poincaré boundary ( at ). Along this prefix, HypRiLM satisfies (panel c)—inside the ball and consistent with the post-training range in Table IX. Flat RiLM follows a comparable low-dimensional path in .
Distance-based decoding in practice. After the prefix “along with … city of”, both models rank was and related function words among the highest-probability continuations (Table X). Neither model was cherry-picked on this example; it is the first long validation prefix returned by our data loader.
V. DISCUSSION
A. Boundary Collapse as a Trainability Phenomenon
Our first HypRiLM implementation applied directly in Eq. (2). The hyperbolic exponential map can be written . As , the conformal factor grows without bound, tanh saturates, and updated states remain at the boundary. Within three recurrence steps we observed ; geodesic distances to all vocabulary embeddings became nearly equal; logits flattened; and perplexity reached —exactly the uniform-guess baseline (Table IX). This boundary collapse is not a small optimization
TABLE IX
BOUNDARY COLLAPSE VS. MÖBIUS FIX (SEED 42). NAÏVE : 10K TRAIN / 500 VAL SUBSET. MÖBIUS: AFTER TRAINING; PPL ON FULL WT-2 VALIDATION.
| Recurrence | after 3 steps | PPL |
|---|---|---|
| (naïve) | 2000 | |
| Möbius Eq. (4) | 0.29-0.71 | ~54 |

Fig. 2. Validation perplexity per epoch on WikiText-2 (seed 42): naive recurrence vs. Möbius HypRiLM.
issue: it renders naive hyperbolic recurrence untrainable for language modeling at modest depth.
Equation (4) sidesteps the pathology by computing tangent increments at the origin—where is moderate—and translating via , which maps interior points to interior points. After training, stays in [0.29, 0.71] on held-out prefixes and perplexity falls to ~54. Hard projection of after every step was counterproductive (~130 PPL), likely because it interrupts gradient flow along geodesics; we project only embeddings and . We regard stable Möbius recurrence as a necessary engineering contribution alongside geodesic decoding: without it, the hyperbolic instantiation of RiLM does not function.
B. Why Geodesic Decoding Helps at Small Scale
When and are moderate, can consume roughly one third of a standard untied LM's parameters (Table I). Matched baselines respond by shrinking hidden width, which weakens LSTM gates or attention heads. RiLM instead keeps and forces the vocabulary embedding table to serve double duty: tokens are inputs and the targets of distance-based classification. The model cannot learn arbitrary linear functionals of independent of where words live on ; plausible continuations must lie near the contextual trajectory. This coupling may explain why tied LSTM/Transformer models—which remove but decode linearly in —still trail by tens of perplexity points.
Swapping for at fixed yields a large WT-2 gain but not a PTB gain. We do not claim a formal hierarchy theorem for web text; rather, WT-2's broader topical and lexical structure may benefit from the exponential separation hyperbolic space affords, whereas compact PTB sentences are adequately served by flat geometry. Table XI summarizes when each instantiation is preferable in our experiments.
(a) HypRiLM (PCA)

(b) Flat RiLM (PCA)

(c) State norm (HypRiLM)

Fig. 3. Learned geometry on a WT-2 validation prefix (seed 42). (a)–(b) PCA projections with Poincaré boundary (dashed) in (a); (c) along the HypRiLM trajectory.
TABLE X
TOP-5 NEXT-TOKEN CANDIDATES BY GEODESIC DISTANCE AFTER PREFIX “along with … city of” (SEED 42; LOGITS ARE ).
| Rank | HypRiLM / Flat RiLM |
|---|---|
| 1 | <unk> / <unk> |
| 2 | was / was |
| 3 | is / and |
| 4 | had / the |
| 5 | the / in |
Practitioners should treat manifold choice as a validation-set decision, not a default.
C. Relation to Tied Embeddings
Tied LSTM/Transformer models set where is the embedding table, so logits are —a bilinear form in . RiLM instead uses on (or on ). Expanding the Euclidean case, . The term is shared across all words at a given timestep and cancels in the softmax; RiLM logits therefore differ from tied linear decoding by the word-dependent norms and by whether inner products or distances define similarity. Geodesic decoding is not equivalent to tying alone: it imposes a metric structure on how hidden states relate to all vocabulary points simultaneously. Our tied baselines isolate this distinction—they remove but keep linear scoring—and still trail HypRiLM by 59+ PPL on WT-2.
TABLE XI PRACTICAL GUIDE: WHICH RiLM VARIANT TO TRY FIRST (UNDER OUR ~290K, 2K-VOCAB PROTOCOL).
| Setting | Recommendation |
| Noisy web text (WT-2) | HypRiLM (large margin over flat and baselines) |
| Compact newswire (PTB) | Flat RiLM (beats HypRiLM at same φ) |
| |V| ≥ 10k, fixed training budget | Flat RiLM (more stable; similar mean PPL) |
| Need fastest inference | Flat RiLM (~0.15 vs. ~0.52 ms/token) |
D. Efficiency and Limitations
Per generated token, RiLM requires work for and for distance evaluation—the same order as softmax over . The benefit is parametric: eliminating at small . Measured on WikiText-2 (seed 42, autoregressive ms/token), Flat RiLM averages 0.15 ms/token, HypRiLM 0.52 ms/token, LSTM 0.44 ms/token, and Transformer 0.40 ms/token. Hyperbolic operations add ~3.5× overhead over Flat RiLM but remain in the same ballpark as the recurrent baselines; Flat RiLM is the fastest variant in this benchmark.
Our study is intentionally bounded. Results use <2M parameters in the largest 10k-vocab setting, context 64, and TBPTT . The 2k vocabulary is a controlled instrument, not a claim about full WikiText-2 benchmarking. Our SSM baseline is a lightweight diagonal model, not a tuned Mamba implementation; SSM uses best-validation checkpoint selection while other models use the final epoch—a potential advantage for SSM that our headline gaps absorb. Matched baselines equalize parameter count but not representation width. Reported ms/token timings use autoregressive generation with model-specific prefix lengths (see supplementary material) and are indicative, not hardware-independent benchmarks. Product-manifold variants improved WT-2 by only ~3 PPL at higher complexity in exploratory runs. All models are trained from scratch without distillation.
Scaling outlook. At full vocabulary (), dominates even billion-parameter transformers—but RiLM's decoding cost remains, and geodesic distance over the full table may need approximation (hierarchical softmax, sampled negatives, or product-manifold factorization of ). Our 10k study is a first stress test: RiLM variants stay ~2× better than SSM-tied but flat geometry becomes competitive with hyperbolic. We expect the decoding idea to matter most where is moderate and parameters scarce; whether curvature helps at scale is an open empirical question we do not resolve here. Extending RiLM to full vocabulary and wider embeddings is the natural next step for community-scale evaluation.
VI. CONCLUSION
RiLM reframes small language modeling as geometry: context is a path on a manifold, and decoding reads distances to vocabulary points rather than applying a separate output matrix. With a shared MLP and ~290k parameters, HypRiLM leads on WikiText-2 against fair LSTM, Transformer, and SSM baselines; Flat RiLM is preferable on Penn Treebank; both beat tied and matched controls on both corpora. Stable Möbius recurrence proved essential—without it, hyperbolic RiLM does not train.
Within the controlled regime we study, geodesic decoding is a concrete way to couple representation and prediction when parameters are scarce. It is not a drop-in replacement for billion-parameter pretraining, but it offers a principled alternative to whose benefits persist under tied and matched comparisons and partially under larger . We hope the framework, the boundary-collapse analysis, and the multi-seed protocol provide a reproducible baseline for future work on geometric language models.
REFERENCES
[1] S. Hochreiter and J. Schmidhuber, "Long short-term memory," Neural Comput., vol. 9, no. 8, 1997. [2] A. Vaswani et al., "Attention is all you need," in Proc. NeurIPS, 2017. [3] A. Radford et al., "Language models are unsupervised multitask learners," OpenAI Tech. Rep., 2019. [4] Z. Dai et al., "Transformer-XL: Attentive language models beyond a fixed-length context," in Proc. ACL, 2019. [5] O. Press and L. Wolf, "Using the output embedding to improve language models," in Proc. EACL, 2017. [6] M. Nickel and D. Kiela, "Poincaré embeddings for learning hierarchical representations," in Proc. NeurIPS, 2017. [7] O. Ganea, G. Bécigneul, and T. Hofmann, "Hyperbolic neural networks," in Proc. NeurIPS, 2018. [8] S. Merity, N. S. Keskar, and R. Socher, "Regularizing and optimizing LSTM language models," in Proc. ICLR, 2018. [9] E. J. Hu et al., "LoRA: Low-rank adaptation of large language models," in Proc. ICLR, 2022. [10] R. T. Q. Chen et al., "Neural ordinary differential equations," in Proc. NeurIPS, 2018. [11] D. J. Rezende and S. Mohamed, "Variational inference with normalizing flows," in Proc. ICML, 2015. [12] A. Gu and T. Dao, "Mamba: Linear-time sequence modeling with selective state spaces," arXiv:2312.00752, 2023.