← Latest papers
💬 NLP

Mitigating Position Bias in Transformers via Layer-Specific Positional Embedding Scaling

This paper introduces Layer-Specific Positional Embedding Scaling (LPES), a method that mitigates the "lost-in-the-middle" problem in Large Language Models by assigning distinct, optimally selected scaling factors to each layer via a genetic algorithm, thereby improving attention distribution and retrieval accuracy without requiring fine-tuning or increasing inference latency.

Original authors: Changze Lv, Zhenghua Wang, Yiran Ding, Yixin Wu, Tianlong Li, Zhibo Xu, Muling Wu, Tianyuan Shi, Shizheng Li, Qi Qian, Xuanjing Huang, Xiaoqing Zheng

Published 2026-06-29
📖 4 min read☕ Coffee break read

Original authors: Changze Lv, Zhenghua Wang, Yiran Ding, Yixin Wu, Tianlong Li, Zhibo Xu, Muling Wu, Tianyuan Shi, Shizheng Li, Qi Qian, Xuanjing Huang, Xiaoqing Zheng

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you have a very smart librarian (a Large Language Model) who is trying to find a specific fact inside a massive, 100-page book.

The Problem: The "Middle-Child" Syndrome
Unfortunately, this librarian has a bad habit. When the book is too long, they tend to pay too much attention to the first few pages and the last few pages, while completely ignoring the middle. If the answer you need is hidden in the middle of the book, the librarian often misses it. This is called the "lost-in-the-middle" problem.

The Old Solutions: The "Brute Force" Approach
Previous attempts to fix this were like hiring seven different librarians to read the same book simultaneously. Each librarian would use a slightly different reading strategy (a different "scaling factor") to try to find the answer. Then, you'd have to combine all seven of their answers to get the right one.

  • The Downside: This is incredibly slow and expensive. It's like paying seven people to do the job of one just to get a better result.

The New Solution: LPES (The "Layer-Specific" Librarian)
The authors of this paper propose a smarter way called LPES (Layer-Specific Positional Embedding Scaling). Instead of hiring seven librarians, they teach one librarian how to adjust their focus perfectly as they read through the book, page by page.

Here is how it works, using a simple analogy:

1. The "Layer" Concept

Think of the librarian's brain as a multi-story building with 32 floors (layers).

  • Old Way: The librarian used the same "reading glasses" on every single floor.
  • LPES Way: The librarian puts on a different pair of glasses on every floor.
    • On the bottom floors, the glasses might be set to focus heavily on the beginning of the book.
    • On the middle floors, the glasses shift to focus intensely on the middle.
    • On the top floors, they adjust to focus on the end.
      This allows the librarian to catch information no matter where it is hidden, without needing seven different people.

2. The "Bezier Curve" (The Smooth Road)

You might ask: "How do you decide exactly what glasses to put on each of the 32 floors? If you guess randomly, it could take forever to find the right combination."

The authors used a mathematical trick called a Bezier Curve.

  • The Analogy: Imagine you are drawing a smooth, curvy road on a map. Instead of trying to draw every single inch of the road perfectly, you just place four or five "control pins" on the map. The computer then automatically draws a perfectly smooth, curvy road connecting those pins.
  • Why it helps: Instead of searching for the perfect setting for all 32 floors (which is like trying to guess 32 random numbers), the computer only needs to find the perfect position for 4 or 5 pins. The smooth road (the curve) ensures that the focus shifts gradually and naturally from the bottom of the building to the top, rather than jumping around chaotically.

3. The "Genetic Algorithm" (The Evolutionary Search)

To find the best positions for those "control pins," the authors used a Genetic Algorithm.

  • The Analogy: Imagine a game of "Hot and Cold." The computer generates 100 random sets of pins (like 100 different maps). It tests them to see which one helps the librarian find the most answers.
  • It takes the best maps, mixes them together (like breeding), and makes small random tweaks (mutations).
  • Over a few hours, the "maps" evolve into the perfect smooth curve that helps the librarian find answers in the middle of the book.

The Results

The paper claims that this new method is a huge win for three reasons:

  1. It's Fast: Unlike the old method that needed seven librarians (seven passes through the book), this new method only needs one pass. It is roughly 2.4 times faster than the best previous method.
  2. It Works Better: It significantly reduces the "lost-in-the-middle" problem. In tests, it improved accuracy by up to 11.2% when finding information in the middle of long texts.
  3. No Training Needed: You don't have to re-teach the librarian (re-train the model) how to read. You just give them these new "glasses" (scaling factors) and let them go. It works immediately on existing models.

In Summary:
The paper introduces a way to fix a blind spot in AI models by giving them a smooth, graduated set of "focus tools" for different parts of their brain. They found the perfect settings for these tools using a smart, evolutionary search that only required a few "control points" to draw a smooth curve, making the AI faster, smarter, and much better at finding information in the middle of long documents.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →