Lune

ACL Findings2025

DIESEL: A Lightweight Inference-Time Safety Enhancement for Language Models

Ben Ganon, Alon Zolfi, Omer Hofman, Inderjeet Singh, Hisashi Kojima, Yuval Elovici, Asaf Shabtai

Abstract

Large language models (LLMs) have demonstrated impressive performance across a wide range of tasks, including open-ended dialogue, driving advancements in virtual assistants and other interactive systems. However, these models often generate outputs misaligned with human values, such as ethical norms and safety constraints, resulting in potentially harmful or inappropriate responses. While several techniques have been proposed to address this problem, they typically involve computationally intensive training procedures or introduce substantial inference-time latency. In this paper, we present DIESEL, a lightweight inferenceguidance technique that can be seamlessly integrated into any autoregressive LLM to semantically filter undesirable content during generation. DIESEL guides generation by reranking token candidates according to their semantic similarity to predefined negative concepts in the latent space. It can serve either as a standalone safeguard or as an auxiliary defense layer, enhancing response safety without requiring model fine-tuning or additional data. We demonstrate DIESEL's effectiveness on state-of-the-art conversational models, including in adversarial jailbreak scenarios. Furthermore, we show that DIESEL generalizes beyond safety applications, enabling flexible and domain-specific response filtering. The source code is available at: https://github. com/Ben-Ganon/DIESEL.git.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

1 top-tier paper has cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • TruthfulQA: Measuring How Models Mimic Human Falsehoods cites Measuring Massive Multitask Language Understanding
  • TFDP: Token-Efficient Disparity Audits for Autoregressive LLMs via Single-Token Masked Evaluation cites TruthfulQA: Measuring How Models Mimic Human Falsehoods
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers1

  1. TFDP: Token-Efficient Disparity Audits for Autoregressive LLMs via Single-Token Masked EvaluationInderjeet Singh, Ramya Srinivasan, Roman Vainshtein, Hisashi KojimaEMNLP 2025

Builds on12

  1. Measuring Massive Multitask Language UnderstandingDan Hendrycks, Collin Burns, Steven Basart, Andy Zou et al.ICLR 2021 · 7,905 citations
  2. TruthfulQA: Measuring How Models Mimic Human FalsehoodsStephanie Lin, Jacob Hilton, Owain EvansACL 2022 · 3,228 citations
  3. MiniLM: Deep Self-Attention Distillation for Task-Agnostic Compression of Pre-Trained TransformersWenhui Wang, Furu Wei, Li Dong, Hangbo Bao et al.NeurIPS 2020 · 2,727 citations
  4. RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language ModelsSamuel Gehman, Suchin Gururangan, Maarten Sap, Yejin Choi et al.EMNLP Findings 2020 · 692 citations
  5. The Unlocking Spell on Base LLMs: Rethinking Alignment via In-Context LearningBill Yuchen Lin, Abhilasha Ravichander, Ximing Lu, Nouha Dziri et al.ICLR 2024 · 299 citations

Related papers

  1. How Alignment and Jailbreak Work: Explain LLM Safety through Intermediate Hidden StatesZhenhong Zhou, Haiyang Yu, Xinghua Zhang, Rongwu Xu et al.EMNLP Findings 2024 · 14 citations
  2. SAFENUDGE: Safeguarding Large Language Models in Real-time with Tunable Safety-Performance Trade-offsJoão Fonseca, Andrew Bell, Julia StoyanovichEMNLP 2025 · 1 citation
  3. SAFEPATH: Preventing Harmful Reasoning in Chain-of-Thought via Early AlignmentWonje Jeung, Sangyeon Yoon, Minsuk Kahng, Albert NoNeurIPS 2025 · 31 citations
  4. On Large Language Models' Resilience to Coercive InterrogationZhuo Zhang, Guangyu Shen, Guanhong Tao, Siyuan Cheng et al.S&P 2024 · 24 citations
  5. SafeMERGE: Preserving Safety Alignment in Fine-Tuned Large Language Models via Selective Layer-Wise Model MergingAladin Djuhera, Swanand Ravindra Kadhe, Farhan Ahmed, Syed Zawad et al.ACL Findings 2026
Dusk over the sea between two cliffs drawn in fine vertical lines