cs.CLJun 30, 2024

LaSEr-Edit: Localized Span-level Error Editing with Energy-based Localization

Authors: Hye Ryung Son, Saehee Eom, Mooho Song, Jay-Yoon Lee

Organizations: Graduate School of Data Science Seoul National University · Georgia Institute of Technology

Abstract

As large language models (LLMs) are widely adopted in real-world applications, it has become critical to ensure LLMs satisfy safety constraints, such as non-toxicity and logical consistency, as well as task- and situation-specific constraints. Controlling the output through instructions is a simple and tempting approach; however, it remains brittle, is opaque in how it influences model behavior, and thus cannot reliably ensure constraint satisfaction. Moreover, most recent controlled text generation (CTG) methods require access to the internal components of language models--such as weights or logits--making them incompatible with popular API-based LLMs. In this work, we propose LaSEr-Edit, a constraint-satisfying text revision method that can be applied to any LLMs, black- or white-box. We first find that lightweight, task-specific energy-based models (EBMs) achieve error-localization performance competitive with or even better than that of much larger LLMs, while operating substantially faster. Based on this finding, we propose two variants of text revision methods that incorporate energy-based error localization: LaSEr-LLM Edit, which instructs an LLM to edit text given EBM-predicted error spans, and LaSEr-EBM Edit, which uses the EBM not only for localization but also for editing by reranking edit candidates. Through experiments in diverse single-constraint control tasks, we show that LaSEr-LLM Edit controls text better than plain LLM-based editing in most of the tasks. We also find that LaSEr-EBM Edit further improves the control performance of LaSEr-LLM Edit and achieves among the strongest controllability across all tasks. Furthermore, we find that LaSEr-Edit, especially LaSEr-EBM Edit, performs well even when multiple constraints are controlled simultaneously.

Figures & tables

Appendix figures & tables20 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. LiSeCo: Linear Semantic Control for Language Generation

    May 24, 2024Emily Cheng, Carmen Amo AlonsoLarge Language Model GenerationLinear Activation Steering

  2. Safety Reconstructed: Generative Modeling via Masked Diffusion Builds Strong Safety Guardrails

    Sep 27, 2026Gert Lek, Abele Malan, Chaoyi Zhu +3Large Language Model SafetyMasked Diffusion Language Models

  3. Edit-level Majority Voting Mitigates Over-Correction in LLM-based Grammatical Error Correction

    May 13, 2026Takumi Goto, Yusuke Sakai, Taro WatanabeGrammatical Error CorrectionCorrection