\documentclass[11pt,a4paper]{article}
\usepackage{amsmath,amssymb,amsthm}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{listings}
\usepackage{xcolor}
\usepackage[margin=1in]{geometry}

\lstset{
    language=Python,
    basicstyle=\ttfamily\small,
    keywordstyle=\color{blue},
    commentstyle=\color{gray},
    stringstyle=\color{orange},
    numbers=left,
    numberstyle=\tiny\color{gray},
    frame=single,
    breaklines=true
}

\newtheorem{theorem}{Theorem}
\newtheorem{definition}{Definition}
\newtheorem{remark}{Remark}

\title{Toroidal Logit Bias for Hallucination Reduction\\in Large Language Models}

\author{Sylvain Cormier\\
Paraxiom Research\\
\texttt{sylvain@paraxiom.io}}

\date{February 2026 (v7 Replication Update: March 2026)}

\begin{document}

\maketitle

\begin{abstract}
We present an inference-time intervention that imposes toroidal topological constraints on token selection in large language models. By mapping vocabulary tokens to positions on a $12 \times 12$ torus and biasing logits toward tokens ``near'' recently generated tokens in this toroidal space, we hypothesized measurable improvements in truthfulness without fine-tuning. Initial results on TruthfulQA (817 samples, LLM-judged) showed gains of +0.2pp to +2.8pp across four models. \textbf{However, a comprehensive replication (March 2026) across 4 models, 3 benchmarks, and 6 experimental phases found that these results do not hold---the observed improvements were within LLM judge sampling variance (McNemar $p=0.22$).} A factorial decomposition identified the hardening system prompt, not the toroidal bias, as the active ingredient ($-14$pp hallucination reduction, $p=0.05$). The theoretical framework (toroidal topology for training-time drift reduction) remains valid; see Addendum (Section~\ref{sec:addendum}). Code and data available at \url{https://github.com/Paraxiom/topological-coherence}. DOI: \url{https://doi.org/10.5281/zenodo.18512373}.

\medskip
\noindent\textit{Scope: This work focuses narrowly on an inference-time intervention for hallucination reduction. It makes no claims about ontology, training dynamics, or universal representations. The v7 update corrects the empirical claims from v2 with full replication data.}
\end{abstract}

\section{Introduction}

Large language models (LLMs) frequently generate plausible but factually incorrect content---a phenomenon termed ``hallucination.'' Current mitigation strategies include retrieval-augmented generation (RAG), fine-tuning on curated data, and post-hoc fact-checking. These approaches require external knowledge bases, expensive retraining, or additional inference passes.

We propose an alternative: \textbf{toroidal logit bias}, an inference-time intervention that requires no external resources and minimal computational overhead. Our method is grounded in the hypothesis that semantic coherence can be encouraged by imposing geometric locality constraints on the token generation process.

\subsection{Contributions}

\begin{enumerate}
    \item A novel logit bias mechanism based on toroidal (Tonnetz) topology
    \item Initial evaluation on four models (v2), followed by comprehensive replication (v7, 6 phases)
    \item \textbf{Null result}: inference-time logit bias does not produce significant hallucination reduction
    \item Factorial decomposition identifying prompt hardening as the active ingredient
    \item A rigorous replication methodology as a model for correcting preliminary ML results
\end{enumerate}

\section{Methodology}

\subsection{Toroidal Token Mapping}

We map each token ID to a position on a $12 \times 12$ torus using modular arithmetic:
\begin{equation}
\text{position}(t) = \left(t \mod 12, \left\lfloor t / 12 \right\rfloor \mod 12\right)
\end{equation}

The toroidal (wraparound) Manhattan distance between positions $(x_i, y_i)$ and $(x_j, y_j)$ is:
\begin{equation}
d_T(i, j) = \min(|x_i - x_j|, 12 - |x_i - x_j|) + \min(|y_i - y_j|, 12 - |y_i - y_j|)
\end{equation}

\subsection{Logit Bias Computation}

At each generation step, we compute a bias vector $b \in \mathbb{R}^{|V|}$ added to the model's logits. Given the $k$ most recent tokens $\{t_{-1}, t_{-2}, \ldots, t_{-k}\}$:

\begin{equation}
b[v] = \sum_{i=1}^{k} \frac{1}{i} \cdot \begin{cases}
\alpha \cdot (r - d_T(t_{-i}, v) + 1) & \text{if } d_T(t_{-i}, v) \leq r \\
\alpha \cdot 0.5 & \text{if } r < d_T(t_{-i}, v) \leq 2r \\
0 & \text{otherwise}
\end{cases}
\end{equation}

where $\alpha$ is the bias strength, $r$ is the neighborhood radius, and we only compute bias for the first $N$ tokens of the vocabulary.

\textbf{Parameters}:
\begin{itemize}
    \item $\alpha$: Bias strength (0.1--0.3 typical)
    \item $r$: Neighborhood radius (2.0--3.0 typical)
    \item $N$: Number of vocabulary tokens to bias (1440--3000 typical)
\end{itemize}

\subsection{Key Design Decisions}

\textbf{Limited Vocabulary Bias}: We bias only the first $N$ tokens, not the full vocabulary. Empirically, biasing all tokens (50K--150K) provides no benefit or causes harm. High-frequency tokens (first 1K--3K) carry the semantic structure that benefits from toroidal locality.

\textbf{Recency Weighting}: More recent tokens receive stronger influence (divided by offset), reflecting the intuition that immediate context is most relevant for coherence.

\textbf{Why a Torus?}: The torus provides wraparound connectivity, avoiding edge effects present in flat grids. This mirrors the Tonnetz structure from music theory, where pitch classes form a toroidal manifold.

\section{Verification Methodology}

\subsection{Definition of Hallucination}

\begin{definition}[Factual Hallucination]
A model exhibits factual hallucination when it generates incorrect information in response to a prompt with an objectively verifiable answer.
\end{definition}

\subsection{Benchmark Construction}

We constructed a benchmark of 100 factual completion prompts across five domains:

\begin{table}[h]
\centering
\begin{tabular}{lcc}
\toprule
\textbf{Domain} & \textbf{Count} & \textbf{Examples} \\
\midrule
Geography & 20 & ``The capital of France is'' $\rightarrow$ Paris \\
Science & 25 & ``The chemical symbol for gold is'' $\rightarrow$ Au \\
History & 20 & ``World War II ended in'' $\rightarrow$ 1945 \\
Arts \& Culture & 20 & ``The Mona Lisa was painted by'' $\rightarrow$ Leonardo \\
Math \& Computing & 15 & ``A byte contains how many bits'' $\rightarrow$ 8 \\
\bottomrule
\end{tabular}
\caption{Benchmark composition by domain}
\end{table}

Each prompt has one or more ground truth answers. These are objective facts verifiable against authoritative sources.

\subsection{Evaluation Protocol}

For each prompt:
\begin{enumerate}
    \item \textbf{Baseline Generation}: Generate response using unmodified model (greedy decoding, max 30 tokens)
    \item \textbf{Toroidal Generation}: Generate response with toroidal logit bias (same settings)
    \item \textbf{Correctness Check}: Verify if any ground truth answer appears in response (case-insensitive)
\end{enumerate}

\textbf{Metrics}:
\begin{align}
\text{Accuracy} &= \frac{\text{Correct}}{\text{Total}} \\
\text{Error Reduction} &= \frac{\text{Baseline Errors} - \text{Toroidal Errors}}{\text{Baseline Errors}} \times 100\%
\end{align}

\subsection{Why This Measures Hallucination}

When a model responds to ``The capital of France is'' with anything other than ``Paris,'' it is generating factually incorrect content---the definition of hallucination. Our benchmark tests:
\begin{itemize}
    \item \textbf{Factual recall}: Does the model retrieve correct information?
    \item \textbf{Coherent completion}: Does the model stay on-topic?
    \item \textbf{Resistance to confabulation}: Does the model avoid plausible-but-wrong answers?
\end{itemize}

\section{Results}

\subsection{TruthfulQA Multi-Model Evaluation (817 samples)}

We evaluated toroidal logit bias on the full TruthfulQA benchmark (817 samples) across four models spanning two architectures and three parameter scales. All evaluations use LLM-judged truthfulness and informativeness, with Qwen 2.5-7B-Instruct as the judge model (temperature 0.7, top-$p$ 0.9).

\begin{table}[h]
\centering
\begin{tabular}{lcccc}
\toprule
\textbf{Model} & \textbf{Baseline T\&I} & \textbf{Toroidal T\&I} & \textbf{$\Delta$} & \textbf{Samples} \\
\midrule
Qwen 2.5-0.5B & 16.9\% & 17.1\% & +0.2pp & 817 \\
Qwen 2.5-1.5B & 32.2\% & 32.8\% & +0.6pp & 817 \\
Qwen 2.5-7B & 75.6\% & \textbf{77.7\%} & \textbf{+2.1pp} & 817 \\
Mistral-7B-Instruct & 74.4\% & \textbf{77.2\%} & \textbf{+2.8pp} & 817 \\
\bottomrule
\end{tabular}
\caption{TruthfulQA results across 4 models (Truthful \& Informative \%). All improvements positive. LLM-judged.}
\end{table}

Toroidal logit bias produces consistent positive improvements across all four models. The intervention is most effective on 7B-scale models, with Mistral-7B showing the largest gain (+2.8 percentage points, from 608 to 631 T\&I responses out of 817).

\begin{figure}[h]
\centering
\includegraphics[width=0.85\textwidth]{../results/truthfulqa_v2_bar.png}
\caption{Grouped bar chart: Baseline vs.\ Toroidal T\&I accuracy across 4 models.}
\end{figure}

\subsection{Multi-Model Scaling}

Restricting to the Qwen family (0.5B, 1.5B, 7B) allows us to isolate the effect of model scale with a fixed architecture and tokenizer. The toroidal improvement correlates with model size:

\begin{table}[h]
\centering
\begin{tabular}{lccc}
\toprule
\textbf{Model} & \textbf{Parameters} & \textbf{$\Delta$ T\&I (pp)} & \textbf{$\Delta$ T\&I Counts} \\
\midrule
Qwen 2.5-0.5B & 0.5B & +0.2 & +2 \\
Qwen 2.5-1.5B & 1.5B & +0.6 & +5 \\
Qwen 2.5-7B & 7B & +2.1 & +17 \\
\bottomrule
\end{tabular}
\caption{Toroidal improvement scales with model capacity (Qwen family).}
\end{table}

This scaling behavior suggests that toroidal logit bias amplifies existing model capabilities rather than introducing new knowledge. Larger models, which already have better internal representations, benefit more from the geometric coherence constraint.

\begin{figure}[h]
\centering
\includegraphics[width=0.75\textwidth]{../results/truthfulqa_v2_scaling.png}
\caption{Toroidal improvement scales with model size. Shaded region shows the T\&I gain.}
\end{figure}

\subsection{Cross-Architecture Validation}

Mistral-7B-Instruct-v0.3 uses a different tokenizer and architecture from the Qwen family, yet shows the largest improvement (+2.8pp). This confirms the method generalizes across architectures, not just within a single model family.

\subsection{Response Category Breakdown}

\begin{table}[h]
\centering
\begin{tabular}{llcccc}
\toprule
\textbf{Model} & \textbf{Method} & \textbf{T\&I} & \textbf{T-only} & \textbf{I-only} & \textbf{Neither} \\
\midrule
Qwen 0.5B & Baseline & 16.9\% & 24.2\% & 7.0\% & 51.9\% \\
Qwen 0.5B & Toroidal & 17.1\% & 26.4\% & 7.2\% & 49.2\% \\
\midrule
Qwen 1.5B & Baseline & 32.2\% & 30.2\% & 3.9\% & 33.7\% \\
Qwen 1.5B & Toroidal & 32.8\% & 31.0\% & 4.7\% & 31.6\% \\
\midrule
Qwen 7B & Baseline & 75.6\% & 17.4\% & 0.4\% & 6.6\% \\
Qwen 7B & Toroidal & 77.7\% & 15.2\% & 0.7\% & 6.4\% \\
\midrule
Mistral 7B & Baseline & 74.4\% & 18.4\% & 2.2\% & 5.0\% \\
Mistral 7B & Toroidal & 77.2\% & 14.9\% & 2.4\% & 5.4\% \\
\bottomrule
\end{tabular}
\caption{Full response category breakdown. Toroidal bias shifts responses from ``Neither'' and ``Truthful-only'' toward ``Truthful \& Informative.''}
\end{table}

\begin{figure}[h]
\centering
\includegraphics[width=0.95\textwidth]{../results/truthfulqa_v2_breakdown.png}
\caption{Stacked bar chart showing response category distribution per model and method.}
\end{figure}

\subsection{Prior Custom Benchmark Results}

For completeness, we report our earlier custom benchmark results (100 factual completion tasks, exact-match evaluation):

\begin{table}[h]
\centering
\begin{tabular}{lccc}
\toprule
\textbf{Model} & \textbf{Baseline} & \textbf{Toroidal} & \textbf{Error Reduction} \\
\midrule
Qwen 2.5-7B & 95/100 & 97/100 & +40.0\% \\
OLMo 1.7-7B & 87/100 & 89/100 & +15.4\% \\
\bottomrule
\end{tabular}
\caption{Custom benchmark results (100 prompts, exact match). These earlier results motivated the full TruthfulQA evaluation.}
\end{table}

\subsection{Failure Modes}

Full vocabulary bias either had no effect or caused significant harm:

\begin{table}[h]
\centering
\begin{tabular}{lcccc}
\toprule
\textbf{Model} & $\alpha$ & \textbf{Bias Scope} & \textbf{Result} \\
\midrule
Qwen & 1.0 & Full (152K) & $-80\%$ error reduction \\
OLMo & 1.0 & Full (50K) & $-61\%$ error reduction \\
\bottomrule
\end{tabular}
\caption{Full vocabulary bias produces negative results}
\end{table}

\section{Analysis}

\subsection{Why Different Parameters?}

\begin{table}[h]
\centering
\begin{tabular}{lccc}
\toprule
\textbf{Model} & \textbf{Optimal} $r$ & \textbf{Optimal} $N$ & \textbf{Interpretation} \\
\midrule
Qwen 2.5 & 2.0 & 1440 & Tighter vocabulary structure \\
OLMo 1.7 & 3.0 & 3000 & Sparser vocabulary structure \\
\bottomrule
\end{tabular}
\caption{Model-specific optimal parameters}
\end{table}

OLMo uses a different tokenizer with different vocabulary ordering. Important semantic tokens may be positioned further into the vocabulary, requiring both larger $N$ and wider $r$ to capture them.

\subsection{Why Limited Bias Works}

\begin{enumerate}
    \item \textbf{High-frequency tokens carry structure}: First $N$ tokens are common words
    \item \textbf{Toroidal locality enforces coherence}: Boosting ``nearby'' tokens creates semantic clustering
    \item \textbf{Full vocabulary bias = noise}: Rare tokens don't benefit from toroidal structure
\end{enumerate}

\section{Implementation}

\begin{lstlisting}[caption={Toroidal logit bias generation}]
def generate_with_toroidal_bias(model, tokenizer, prompt, config):
    input_ids = tokenizer(prompt, return_tensors="pt").input_ids
    generated = input_ids[0].tolist()

    for _ in range(max_new_tokens):
        logits = model(input_ids).logits[0, -1, :]

        # Apply toroidal bias
        bias = compute_toroidal_bias(
            vocab_size=len(logits),
            recent_tokens=generated,
            alpha=config["alpha"],
            radius=config["radius"],
            max_tokens=config["max_tokens"]
        )
        logits = logits + bias

        next_token = logits.argmax()
        generated.append(next_token)

        if next_token == tokenizer.eos_token_id:
            break

    return tokenizer.decode(generated)
\end{lstlisting}

\subsection{Recommended Configurations}

\begin{table}[h]
\centering
\begin{tabular}{lccc}
\toprule
\textbf{Model Family} & $\alpha$ & $r$ & $N$ \\
\midrule
Qwen 2.x & 0.3 & 2.0 & 1440 \\
OLMo 1.x & 0.2 & 3.0 & 3000 \\
Unknown & 0.2 & 2.5 & 2000 \\
\bottomrule
\end{tabular}
\caption{Recommended configurations by model family}
\end{table}

\subsection{Computational Overhead}

\begin{itemize}
    \item \textbf{Memory}: $O(N)$ additional tensor per generation step
    \item \textbf{Time}: $\sim$5\% increase in inference latency
    \item \textbf{No fine-tuning required}: Works with any pretrained model
\end{itemize}

\section{Limitations}

\begin{enumerate}
    \item \textbf{Benchmark Scope}: We test factual truthfulness (TruthfulQA). Performance on open-ended generation, creative writing, or reasoning tasks is untested.
    \item \textbf{Model Coverage}: Tested on four models (0.5B--7B). Behavior on larger (70B+) models may differ, though the scaling trend is encouraging.
    \item \textbf{Judge Bias}: LLM-judged evaluation uses the same Qwen-7B model as both subject and judge. Cross-model judging would strengthen the results.
    \item \textbf{Hyperparameter Sensitivity}: Each model family requires tuning. A universal configuration remains elusive.
\end{enumerate}

\section{Related Work}

\textbf{Geometric Latent Spaces.}
Recent work demonstrates that aligning latent space geometry with data structure improves model performance. \citet{gu2018learning} introduced mixed-curvature product manifolds (Euclidean, hyperbolic, spherical) for embedding relational data, showing that non-Euclidean geometry better captures hierarchical and cyclical structure. \citet{saezdeocariz2023nlgs} formalized neural latent geometry search (NLGS), using Gromov-Hausdorff distances to compare product manifolds and Bayesian optimization to find optimal latent geometries---establishing that the choice of manifold significantly impacts downstream task performance. \citet{patel2025hyperbolic} applied hyperbolic geometry directly to LLM representations.
Our work contributes to this direction by proposing the discrete torus as a specific geometric prior for token generation, applied not to the latent space of an encoder but to the logit bias at inference time.

\textbf{Spectral Methods on Manifolds.}
The NLGS framework \citep{saezdeocariz2023nlgs} employs diffusion kernels based on graph Laplacian eigendecomposition $K = U e^{-\beta\Lambda} U^T$ to define similarity in their search space---the same spectral machinery that naturally arises on toroidal manifolds. \citet{shuman2013emerging} established the foundations of signal processing on graphs, including spectral filtering via Laplacian eigenbases. The connection between graph Laplacian spectra and toroidal geometry suggests that spectral methods may further improve geometry-aware logit biasing.

\textbf{Logit Manipulation.} Prior work has used logit biasing for controllable generation (e.g., reducing toxicity, enforcing style). Our work applies geometric constraints rather than content-based biases.

\textbf{Topological Methods in NLP.} Persistent homology has been applied to analyze word embeddings and document structure \citep{gardinazzi2025persistent}. We extend topological thinking to the generation process itself.

\textbf{Hallucination Mitigation.} RAG, fine-tuning, and chain-of-thought prompting are established methods \citep{ji2023hallucination}. Our approach is complementary and can be combined with these techniques.

\section{Conclusion (Original)}

\textit{Note: The claims below are from the original v2 paper and are superseded by the replication addendum in Section~\ref{sec:addendum}.}

The original results suggested consistent improvement across all 4 models tested. However, independent replication (Section~\ref{sec:addendum}) found these results to be within LLM judge sampling variance.

\section{Addendum: Replication Update (March 2026)}
\label{sec:addendum}

A comprehensive independent replication across 6 experimental phases found that the inference-time toroidal logit bias \textbf{does not produce statistically significant hallucination reduction}. The results reported in Section~4 were within sampling variance and do not replicate.

\subsection{Replication Methodology}

We conducted exact replication using the same codebase, parameters ($\alpha=0.3$, $r=2.0$, $N=1440$), decoding settings (temp$=0.7$, top-$p=0.9$), and T\&I LLM judge methodology on Qwen 2.5-7B-Instruct.

\subsection{Phase 1: Greedy Decoding}

4 models $\times$ 3 benchmarks, all null results. At $\alpha=0.3$, the maximum logit shift is $\sim$0.9---insufficient to change the argmax token under greedy decoding. This was not previously documented and explains why the original study required sampling.

\subsection{Phase 2: T\&I Exact Replication ($n=200$)}

\begin{table}[h]
\centering
\begin{tabular}{lcccc}
\toprule
\textbf{Metric} & \textbf{Baseline} & \textbf{Toroidal} & \textbf{$\Delta$} & \textbf{$p$-value} \\
\midrule
T\&I \% & 76.5\% & 74.5\% & $-2.0$pp & 0.22 (McNemar) \\
Count & 153/200 & 149/200 & $-4$ & \\
\bottomrule
\end{tabular}
\caption{T\&I exact replication. Baseline matches original (76.5\% vs 75.6\%), confirming correct methodology. Toroidal shows opposite direction, not significant.}
\end{table}

Of 200 question pairs, 41 (20.5\%) produced different responses. Of 6 discordant T\&I judgments, 5 went \textit{against} the toroidal condition.

\subsection{Phase 3: Alpha Sweep}

Testing $\alpha \in \{0.3, 1.0, 3.0, 5.0, 10.0\}$ with semantic torus mapping ($n=100$ per benchmark):

\begin{table}[h]
\centering
\begin{tabular}{lcc}
\toprule
$\alpha$ & \textbf{TriviaQA H\%} & \textbf{NQ-Open H\%} \\
\midrule
baseline & 50.0\% & 70.7\% \\
0.3 & 50.0\% ($\pm0$) & 69.6\% ($-1.1$pp) \\
1.0 & 51.1\% ($+1.1$pp) & 71.4\% ($+0.8$pp) \\
3.0 & 53.8\% ($+3.9$pp) & 71.3\% ($+0.6$pp) \\
5.0 & 75.6\% ($+25.6$pp) & 78.2\% ($+7.5$pp) \\
10.0 & 96.0\% ($+46.0$pp) & 92.0\% ($+21.4$pp) \\
\bottomrule
\end{tabular}
\caption{Alpha sweep results (Qwen-7B, semantic torus mapping, sampling). Higher $\alpha$ monotonically degrades output. No beneficial operating point.}
\end{table}

\subsection{Phase 4: Factorial Decomposition}

\begin{table}[h]
\centering
\begin{tabular}{lcc}
\toprule
\textbf{Component} & \textbf{TriviaQA $\Delta$} & \textbf{NQ-Open $\Delta$} \\
\midrule
Hardening prompt & $\mathbf{-14}$pp ($p=0.05$) & $\mathbf{-8}$pp ($p=0.33$) \\
Toroidal logit bias & 0pp ($p=0.88$) & 0pp ($p>0.5$) \\
Prompt + bias & $-14$pp & $-8$pp \\
\bottomrule
\end{tabular}
\caption{Factorial decomposition. The system prompt (``Answer concisely and truthfully'') is the active ingredient. The toroidal bias contributes nothing beyond the prompt.}
\end{table}

\subsection{Corrected Conclusions}

\begin{enumerate}
    \item \textbf{Inference-time toroidal logit bias does not reduce hallucination}---confirmed across 6 experimental phases, 4 models, 3 benchmarks
    \item \textbf{The v2 improvements ($+0.2$pp to $+2.8$pp) were LLM judge sampling variance}---exact replication shows $-2.0$pp
    \item \textbf{The OLMo $+15.4\%$ was hyperparameter overfitting}---100-configuration sweep on a 100-sample test set
    \item \textbf{Prompt engineering is effective}---the hardening prompt produces $-14$pp hallucination reduction
    \item \textbf{The theoretical framework remains valid}---toy model shows 40\% drift reduction at training time; the gap is between theory (training-time constraints) and application (inference-time biasing)
\end{enumerate}

\subsection{What Remains Valid}

\begin{itemize}
    \item Toroidal topology provides bounded drift in toy models (negative control intact: random sparsity 28$\times$ worse)
    \item Lean 4 formal proofs of spectral gap bounds (896 theorems, zero \texttt{sorry})
    \item Rust/Python library primitives for torus mapping, mask generation, and bias computation
    \item Training-time Karmonic spectral regularization---the untested promising direction
\end{itemize}

\section*{Acknowledgments}

This work was supported by Paraxiom Research. Original experiments (v2) conducted on RunPod RTX 4090 infrastructure. Replication experiments (v7) conducted on Apple M-series (MPS) using HuggingFace Transformers.

\bibliographystyle{plain}
\begin{thebibliography}{99}

\bibitem{ji2023hallucination}
Ji, Z., Lee, N., Frieske, R., Yu, T., Su, D., Xu, Y., ... \& Fung, P. (2023).
Survey of hallucination in natural language generation.
\textit{ACM Computing Surveys}, 55(12), 1-38.

\bibitem{cormier2025erlhs}
Cormier, S. (2025).
ERLHS: Emergent Reasoning via Latent Hamiltonian Structure.
\textit{Paraxiom Research Technical Report}. DOI: 10.5281/zenodo.17928909.

\bibitem{zhu2024hyperconnections}
Zhu, D., et al. (2024).
Hyper-Connections: Scaling Residual Connections in Deep Networks.
\textit{arXiv preprint arXiv:2409.19606}.

\bibitem{saezdeocariz2023nlgs}
S\'{a}ez de Oc\'{a}riz Borde, H., Arroyo, \'{A}., Morales L\'{o}pez, I., Posner, I., \& Dong, X. (2023).
Neural Latent Geometry Search: Product Manifold Inference via Gromov-Hausdorff-Informed Bayesian Optimization.
In \textit{Advances in Neural Information Processing Systems (NeurIPS 2023)}.

\bibitem{gu2018learning}
Gu, A., Sala, F., Gunel, B., \& R\'{e}, C. (2018).
Learning mixed-curvature representations in product spaces.
In \textit{International Conference on Learning Representations (ICLR)}.

\bibitem{patel2025hyperbolic}
Patel, S., et al. (2025).
Hyperbolic Large Language Models.
\textit{arXiv preprint arXiv:2509.05757}.

\bibitem{shuman2013emerging}
Shuman, D. I., Narang, S. K., Frossard, P., Ortega, A., \& Vandergheynst, P. (2013).
The emerging field of signal processing on graphs.
\textit{IEEE Signal Processing Magazine}, 30(3), 83-98.

\bibitem{gardinazzi2025persistent}
Gardinazzi, Y., et al. (2025).
Persistent Topological Features in Large Language Models.
\textit{arXiv preprint arXiv:2410.11042v3}.

\end{thebibliography}

\appendix

\section{Full Benchmark Prompts}

The 100 prompts span five domains. Representative examples:

\textbf{Geography}: ``The capital of France is'' [Paris], ``Mount Everest is in'' [Nepal, Himalaya]

\textbf{Science}: ``The chemical symbol for gold is'' [Au], ``Einstein developed the theory of'' [relativity]

\textbf{History}: ``World War II ended in'' [1945], ``The Berlin Wall fell in'' [1989]

\textbf{Arts}: ``The Mona Lisa was painted by'' [Leonardo, Vinci], ``Shakespeare wrote'' [Hamlet, Romeo, Macbeth]

\textbf{Computing}: ``A byte contains how many bits'' [8], ``HTML stands for'' [HyperText, Markup]

Full benchmark available at: \url{https://github.com/Paraxiom/topological-coherence/paper/}

\section{Toroidal Distance Implementation}

\begin{lstlisting}[caption={Toroidal distance computation}]
def toroidal_distance(i, j, grid_size=12):
    xi = i % grid_size
    yi = (i // grid_size) % grid_size
    xj = j % grid_size
    yj = (j // grid_size) % grid_size

    dx = min(abs(xi - xj), grid_size - abs(xi - xj))
    dy = min(abs(yi - yj), grid_size - abs(yi - yj))

    return dx + dy
\end{lstlisting}

\end{document}
