Label-Free Post-hoc Alignment of Frozen Language Model Hidden States for Sentence-Similarity Retrieval

GangHo Lee, Yong-Gu Lee


Abstract
Decoder-only large language models (LLMs) carry rich semantic information in their hidden states, but these states are not directly usable for retrieval: they exhibit strong anisotropy and excessive dimensionality, producing distorted cosine-similarity rankings and prohibitive index sizes. A standard solution is to train a dedicated embedding model, which requires positive pairs and substantial compute. We ask a different question: can we make frozen LLM hidden states retrieval-usable purely through post-hoc transformation, without fine-tuning the LLM backbone or using labeled positive pairs? We propose NCWP (Neighbor-Contrastive Whitening Projection), a post-hoc alignment method for symmetric sentence-similarity retrieval that combines ZCA-shrink whitening for global isotropy correction with augmentation-free neighbor-contrastive projection learning, requiring only a single linear projection at inference. On the official STS-Benchmark test split and BEIR-Quora across three decoder-only LLM backbones (Llama-3.1-8B, Qwen1.5-4B, Qwen2-7B), NCWP substantially exceeds the raw Base hidden states at aggressive-compression dimensions (e.g., +23.8 Spearman over Qwen1.5-4B Base on STSBenchmark at 8× compression; +13.6 nDCG@10 over Qwen1.5-4B Base on BEIR-Quora at 32× compression), simultaneously delivering retrieval-quality improvements and index-size reductions; the pattern also holds in breadth analyses on STS12–16+SICK-R and CQADupStack. All main results are reported as mean over three random seeds. We characterize a dimensional crossover in which NCWP’s advantage over PCA-whitening widens monotonically down to 256× compression on Qwen1.5-4B and Qwen2-7B, and provide geometric evidence consistent with the proposed mechanism via anisotropy measurements: NCWP reduces anisotropy on all three LLM backbones by roughly an order of magnitude, to a near-zero residual on Qwen1.5-4B and Llama-3.1-8B and a smaller reduction on Qwen2-7B. NCWP is also complementary to prompt-based extraction: applied on top of PromptEOL it improves over full-dimensional PromptEOL while compressing up to 64×. Code is available at https://github.com/ianleeGH20/NCWP.
Anthology ID:
2026.emnlp-main.2323
Volume:
Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing
Month:
October
Year:
2026
Address:
Budapest, Hungary
Editors:
Hung-Yi Lee, Sunipa Dev, Jessy Li, Desmond Elliott
Venue:
EMNLP
SIG:
SIGDAT
Publisher:
Association for Computational Linguistics
Note:
Pages:
52768–52786
Language:
URL:
https://aclanthology.org/2026.emnlp-main.2323/
DOI:
Bibkey:
Cite (ACL):
GangHo Lee and Yong-Gu Lee. 2026. Label-Free Post-hoc Alignment of Frozen Language Model Hidden States for Sentence-Similarity Retrieval. In Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing, pages 52768–52786, Budapest, Hungary. Association for Computational Linguistics.
Cite (Informal):
Label-Free Post-hoc Alignment of Frozen Language Model Hidden States for Sentence-Similarity Retrieval (Lee & Lee, EMNLP 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.emnlp-main.2323.pdf