EPL (Enhanced Position Layout)

September 5, 2025 ยท View on GitHub

This repository contains links to the experiments from our EMNLP Findings 2025 accepted paper "Position IDs Matter: An Enhanced Position Layout for Efficient Context Compression in Large Language Models".

EPL Illustration

core code

    def get_uniform_position_ids(self, x_1, x_n, voco_num=2):
        # [S]
        tot = x_n-x_1+1
        ratio = tot/voco_num
        return torch.round(
            torch.linspace(x_1 + (ratio - 1) / 2, x_n - (ratio - 1) / 2, steps=voco_num, device=self.device)
            )

Experiment

Note: We conduct experiments on different branches

In Table 4 and Table 7 (main experiments):

In Table 5 (multimodal experiments):

In Table 6 (ablation studies):