Contextually Guided Transformers via Low-Rank Adaptation

Andrey Zhmoginov, Jihwan Lee, Max Vladymyrov, Mark Sandler
6/6/2025
cs.LGcs.CL

No confident code implementation found for this paper. 2 possible matches can be shown below.

Abstract

Large Language Models (LLMs) based on Transformers excel at text processing, but their reliance on prompts for specialized behavior introduces computational overhead. We propose a modification to a Transformer architecture that eliminates the need for explicit prompts by learning to encode context into the model's weights. Our Contextually Guided Transformer (CGT) model maintains a contextual summary at each sequence position, allowing it to update the weights on the fly based on the preceding context. This approach enables the model to self-specialize, effectively creating a tailored model for processing information following a given prefix. We demonstrate the effectiveness of our method on synthetic in-context learning tasks and language modeling benchmarks. Furthermore, we introduce techniques for enhancing the interpretability of the learned contextual representations, drawing connections to Variational Autoencoders and promoting smoother, more consistent context encoding. This work offers a novel direction for efficient and adaptable language modeling by integrating context directly into the model's architecture.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 2 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{zhmoginov2025contextually,
  title  = {Contextually Guided Transformers via Low-Rank Adaptation},
  author = {Andrey Zhmoginov and Jihwan Lee and Max Vladymyrov and Mark Sandler},
  year   = {2025},
  eprint = {2506.05672},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2506.05672v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2506.05672.svg)](https://codeofpaper.com/paper/2506.05672)

Discussion