CoCoLex: Confidence-guided Copy-based Decoding for Grounded Legal Text Generation

Santosh T. Y. S. S, Youssef Tarek Elkhayat, Oana Ichim, Pranav Shetty, Dongsheng Wang +3 more
8/7/2025
cs.CL

No confident code implementation found for this paper.

Abstract

Due to their ability to process long and complex contexts, LLMs can offer key benefits to the Legal domain, but their adoption has been hindered by their tendency to generate unfaithful, ungrounded, or hallucinatory outputs. While Retrieval-Augmented Generation offers a promising solution by grounding generations in external knowledge, it offers no guarantee that the provided context will be effectively integrated.

Show full abstract

To address this, context-aware decoding strategies have been proposed to amplify the influence of relevant context, but they usually do not explicitly enforce faithfulness to the context. In this work, we introduce Confidence-guided Copy-based Decoding for Legal Text Generation (CoCoLex)-a decoding strategy that dynamically interpolates the model produced vocabulary distribution with a distribution derived based on copying from the context. CoCoLex encourages direct copying based on the model's confidence, ensuring greater fidelity to the source. Experimental results on five legal benchmarks demonstrate that CoCoLex outperforms existing context-aware decoding methods, particularly in long-form generation tasks.

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. Any repos shown below are weak matches — 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{s2025cocolex,
  title  = {CoCoLex: Confidence-guided Copy-based Decoding for Grounded Legal Text Generation},
  author = {Santosh T. Y. S. S and Youssef Tarek Elkhayat and Oana Ichim and Pranav Shetty and Dongsheng Wang and Zhiqiang Ma and Armineh Nourbakhsh and Xiaomo Liu},
  year   = {2025},
  eprint = {2508.05534},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2508.05534v1}
}

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/2508.05534.svg)](https://codeofpaper.com/paper/2508.05534)

Discussion