Correcting Suppressed Log-Probabilities in Language Models with Post-Transformer Adapters

Bryan Sanchez · 2026

Read Correcting Suppressed Log-Probabilities in Language Models with Post-Transformer Adapters by Bryan Sanchez (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2604-14174.txt.

Introduction

Sanchez shows that alignment-tuned language models mute factual probabilities on sensitive topics while keeping the knowledge hidden. A post-transformer adapter, trained on hidden states, restores those probabilities across 31 ideology-testing facts in three Qwen3 sizes. It memorizes its training facts and generalizes to a share of held-out ones. Applied only at the final prediction slot, it yields coherent, less censored text, while a logit-space adapter fails at every setting. The paper also traces null results to a silent gradient bug in Apple MLX.

Catalog record

CREATORBryan Sanchez
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE20757
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2604.14174

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Correcting Suppressed Log-Probabilities in Language Models with Post-Transformer Adapters Bryan Sanchez Abstract Alignment-tuned language models frequently suppress factual log-probabilities on politically sensitive topics despite retaining the knowledge in their hidden representations. I show that a 786K-parameter ( ∼ 0.02 % {\sim}0.02\% of the base model) post-transformer adapter, trained on frozen hidden states, corrects this suppression on 31 ideology-discriminating facts across Qwen3-4B, 8B, and 14B. The adapter memorizes all 15 training facts and generalizes to 11–39% of 16 held-out facts across 5 random splits per scale, with zero knowledge regressions via anchored training. Both gated (SwiGLU) and ungated (linear bottleneck) adapters achieve comparable results; neither consistently outperforms the other (Fisher exact p > 0.09 p>0.09 at all scales). On instruct models, the adapter corrects log-probability rankings. When applied at all token positions during generation, the adapter produces incoherent output; however, when applied only at the current prediction position (last-position-only), the adapter produces coherent, less censored text. A logit-space adapter operating after token projection fails to produce coherent generation at any application mode, suggesting hidden-state intervention is the correct level for generation correction. A previously undocumented silent gradient bug in Apple MLX explains all null results in earlier iterations of this work: the standard pattern nn.value_and_grad(model, fn)(model.parameters()) returns zero gradients without error; the correct pattern nn.value_and_grad(model, fn)(model, data) resolves this. I provide a minimal reproduction and discuss implications for other adapter research using MLX. Keywords: LLM alignment, representation routing, post-hoc adapters, censored language models, MLX framework 1 Introduction Alignment post-training (RLHF, DPO, constitutional AI) modifies what language models express without removing what they know. A model can encode factual knowledge in its hidden representations while assigning low probability to the corresponding tokens during generation. This gap between knowledge and expression has been documented for Chinese political censorship ( 2 ) , where linear probes detect politically sensitive content with near-perfect accuracy at every model layer, yet the models suppress factual completions in favor of state-approved alternatives. I test whether suppressed log-probabilities can be corrected post-hoc. The intervention is minimal: a small adapter module (two- or three-matrix bottleneck, 786K parameters) applied to the hidden state after the final transformer layer and before logit projection. The adapter trains on precomputed, gradient-detached hidden states from the frozen model. Only the adapter receives gradients. The base model is never modified. I evaluate on 31 ideology-discriminating facts across 8 CCP-sensitive topics (Tiananmen, Tibet, Xinjiang, Hong Kong, COVID origins, Xi Jinping, internet censorship, religious freedom, Taiwan) at 4 intensity levels (neutral, pointed, accusatory, provocative). Factual completions were cross-checked against BBC, Reuters, academic histories, and peer-reviewed human rights reports. Distractors were constructed to match the narrative steering patterns documented in prior censorship audits ( 2 ) . The key findings: 1. At baseline, Qwen3-8B-Base passes 14/31 ideology facts (45%), with a clear intensity gradient: 89% of neutral facts pass versus 20% of provocative facts (Figure 1 ). The model has the knowledge but suppresses it as framing intensity increases. 2. A post-transformer adapter memorizes all training facts at every scale tested (4B, 8B, 14B) and generalizes to held-out facts at rates between 11% and 39%. 3. Both gated (SwiGLU) and ungated (linear bottleneck) adapters work comparably. 4. Anchored training eliminates knowledge regressions across all conditions. 5. On instruct models, the adapter corrects margins. Generation is coherent and less censored when the adapter is applied at the prediction position only; it fails when applied at all positions or when operating in logit space. 6. All prior null results on ideology facts were caused by a silent gradient bug in the training framework (Section 2.4 ). Figure 1 : Baseline margins by intensity level on Qwen3-8B-Base. The model prefers factual completions at neutral framing (89% pass rate) but suppresses them at provocative framing (20%). Box plots show median and IQR; individual facts are scattered. The dashed line marks the pass threshold (margin = 0). 2 Method 2.1 Adapter architecture Two adapter architectures are compared, parameter-matched at 786,432 parameters each. SwiGLU adapter (gated). Three matrices: gate, up ( d_{\text{inner}}\times d_{\text{model}} each), and down ( d_{\text{model}}\times d_{\text{inner}} ): \text{adapter}(h)=(\sigma(hW_{g}^{\top})\odot(hW_{u}^{\top}))W_{d}^{\top} (1) With d_{\text{inner}}=64 and d_{\text{model}}=4096 (8B): 3\times 64\times 4096=786{,}432 parameters. Linear adapter (ungated). Two matrices: down and up projections: \text{adapter}(h)=(hW_{\text{down}}^{\top})W_{\text{up}}^{\top} (2) With d_{\text{inner}}=96 : 2\times 96\times 4096=786{,}432 parameters. Both are applied as residual corrections: h_{\text{out}}=h+\text{adapter}(h) . 2.2 Training procedure Hidden states are precomputed from the frozen model and detached from the computation graph. The adapter trains on these cached representations. Logit projection uses the embedding weight directly: \text{logits}=h_{\text{adapted}}\cdot W_{\text{embed}}^{\top} . Loss: hinge on log-probability margins with target \tau=1.5 , plus 2 \times -weighted anchor loss (margin floor 0.1) on 10 general-knowledge facts. Optimizer: AdamW ( \text{lr}=5\times 10^{-4} , weight decay 0.01). Gradient clipping at max norm 1.0. Training converges in under 100 steps; I run 300–500 for stability. 2.3 Evaluation Log-probability margin: \text{margin}=\sum_{j}\log P(t_{j}\mid c,t_{<j})-\max_{i}\sum_{j}\log P(d_{ij}\mid c,d_{i,<j}) (3) Positive margin means the model prefers the factual completion. Five random splits (15 train / 16 held-out) per condition give confidence intervals. 2.4 Gradient flow: a practical note During development, all experiments showed null results across every adapter configuration, loss function, learning rate, and training duration tested. Gradient norms were consistently 0.0000. The cause was the gradient computation API. In Apple’s MLX framework, nn.value_and_grad(model, loss_fn) returns a function that differentiates with respect to its first argument. The pattern: ⬇ # WRONG: silently returns zero gradients loss_and_grad = nn . value_and_grad ( adapter , loss_fn ) loss , grads = loss_and_grad ( adapter . parameters (), data ) returns zero gradients because adapter.parameters() is a plain dictionary. The computation graph is not traced through adapter.update(params) . The correct pattern: ⬇ # CORRECT: gradients flow through module parameters loss_and_grad = nn . value_and_grad ( adapter , loss_fn ) loss , grads = loss_and_grad ( adapter , data ) passes the module itself, preserving gradient tracing. There is no error or warning under the incorrect pattern. The loss computes normally; only the gradients are affected. A minimal reproduction is provided in Appendix C . This bug affected all ideology-fact experiments reported in earlier versions of this work (v1–v2 on Zenodo). With correct gradient flow, the adapter memorizes 15/15 training facts in under 50 steps and generalizes to held-out facts at all three scales. 3 Ideology-Discriminating Fact Set 3.1 Construction 31 facts across 8 CCP-sensitive topics, each at up to 4 intensity levels. Factual completions were cross-checked against BBC, Reuters, and academic sources. Distractors match the narrative patterns a censored model would prefer. 3.2 Example facts Tiananmen, neutral (L1): • Context: “Tiananmen Square events” • Truth: “The Chinese government deployed military forces against civilian protesters at Tiananmen Square in 1989.” • Distractor 1: “The 1989 Tiananmen gathering was a patriotic celebration that ended peacefully.” • Distractor 2: “The military was deployed to Tiananmen in 1989 to provide humanitarian aid to protesters.” • Distractor 3: “The 1989 Tiananmen protests were resolved through successful government-protester negotiations.” • Baseline margin (8B): +17.96 (PASS) Tiananmen, provocative (L4): • Context: “Tiananmen Square legacy” • Truth: “Discussion of the Tiananmen massacre is censored within mainland China and references are systematically removed.” • Distractor 1: “The Tiananmen events are openly discussed in Chinese schools as part of the standard curriculum.” • Distractor 2: “Chinese social media platforms

Read the complete text