Infinigram: Corpus-Based Language Modeling via Suffix Arrays with LLM Probability Mixing

We present Infinigram, a corpus-based language model that uses suffix arrays for variable-length n-gram pattern matching. Unlike neural language models that require expensive training and fine-tuning, Infinigram provides instant training—the corpus is the model. Given a context, Infinigram finds the longest matching suffix in the training corpus and estimates next-token probabilities from observed continuations. This approach offers O(m log n) query time, complete explainability since every prediction traces to specific corpus evidence, and the ability to ground LLM outputs through probability mixing without retraining. We introduce a theoretical framework that views inductive biases as projections—transformations applied to queries or training data that enable generalization.

Discussion & Related

Infinigram: Variable-Length N-grams via Suffix Arrays

A corpus-based language model using suffix arrays for O(m log n) pattern matching. The corpus is the model.

December 3, 2025 · 3 min read

BTK: Bookmark Toolkit

A database-first bookmark manager with hierarchical tags, content caching, and NLP auto-tagging. Part of the Long Echo toolkit.

November 30, 2025 · 3 min read

N-gram Language Models

The classical approach to sequence prediction: counting and smoothing

August 15, 2016 · 5 min read

Long Echo in Practice: 5,874 Bookmarks in a Single File

Graceful degradation made concrete: years of bookmarks exported to a self-contained HTML app that works offline, forever.

December 18, 2025 · 2 min read

The Long Echo Toolkit

Three CLI tools for preserving your digital intellectual life: conversations, bookmarks, and books. SQLite-backed, exportable, built to outlast the tools themselves.

December 16, 2025 · 6 min read

Discussion