mlsanityData to 7 Oct 2026

INDICT: Code Generation with Internal Dialogues of Critiques for Both Security and Helpfulness

arXiv 2407.02518 ↗First posted 23 Jun 2024cs.SE cs.AI cs.CLcited by 7

Not on the map. Why?

Abstract (arXiv)

Large language models (LLMs) for code are typically trained to align with natural language instructions to closely follow their intentions and requirements. However, in many practical scenarios, it becomes increasingly challenging for these models to navigate the intricate boundary between helpfulness and safety, especially against highly complex yet potentially malicious instructions. In this work, we introduce INDICT: a new framework that empowers LLMs with Internal Dialogues of Critiques for both safety and helpfulness guidance. The internal dialogue is a dual cooperative system between a safety-driven critic and a helpfulness-driven critic. Each critic provides analysis against the given task and corresponding generated response, equipped with external knowledge queried through relevant code snippets and tools like web search and code interpreter. We engage the dual critic system in both code generation stage as well as code execution stage, providing preemptive and post-hoc guidance respectively to LLMs. We evaluated INDICT on 8 diverse tasks across 8 programming languages from 5 benchmarks, using LLMs from 7B to 70B parameters. We observed that our approach can provide an advanced level of critiques of both safety and helpfulness analysis, significantly improving the quality of output codes (+10% absolute improvements in all models).

Key facts. Cited by 7 papers in the map (data through 7 Oct 2026). Builds on 74 of its 97 references that are in the map. First posted on arXiv 23 Jun 2024.

Builds on

74 of 97 references.

References · 74

  1. 2020Language Models are Few-Shot Learnerscited by 32,199
  2. 2023GPT-4 Technical Reportcited by 18,132
  3. 2022Training language models to follow instructions with human feedbackcited by 15,712
  4. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
  5. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  6. 2023Judging LLM-as-a-Judge with MT-Bench and Chatbot Arenacited by 8,393
  7. 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,355
  8. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  9. 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,767
  10. 2021Program Synthesis with Large Language Modelscited by 3,509
  11. 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,317
  12. 2022Constitutional AI: Harmlessness from AI Feedbackcited by 2,950
38 more
  1. 2019HuggingFace's Transformers: State-of-the-art Natural Language Processingcited by 2,201
  2. 2023Code Llama: Open Foundation Models for Codecited by 2,105
  3. 2023Self-RAG: Learning to Retrieve, Generate, and Critique through Self-Reflectioncited by 1,800
  4. 2023MetaGPT: Meta Programming for A Multi-Agent Collaborative Frameworkcited by 1,761
  5. 2022Competition-Level Code Generation with AlphaCodecited by 1,427
  6. 2023CAMEL: Communicative Agents for "Mind" Exploration of Large Language Model Societycited by 1,348
  7. 2024HarmBench: A Standardized Evaluation Framework for Automated Red Teaming and Robust Refusalcited by 1,330
  8. 2023Jailbreaking Black Box Large Language Models in Twenty Queriescited by 1,326
  9. 2022Inner Monologue: Embodied Reasoning through Planning with Language Modelscited by 1,057
  10. 2022Red Teaming Language Models with Language Modelscited by 983
  11. 2023Large Language Models Cannot Self-Correct Reasoning Yetcited by 965
  12. 2023Teaching Large Language Models to Self-Debugcited by 963
  13. 2023ChatDev: Communicative Agents for Software Developmentcited by 893
  14. 2021Measuring Coding Challenge Competence With APPScited by 879
  15. 2023CRITIC: Large Language Models Can Self-Correct with Tool-Interactive Critiquingcited by 751
  16. 2023WizardCoder: Empowering Code Large Language Models with Evol-Instructcited by 728
  17. 2023In-Context Retrieval-Augmented Language Modelscited by 694
  18. 2023Safe RLHF: Safe Reinforcement Learning from Human Feedbackcited by 630
  19. 2023Tree of Attacks: Jailbreaking Black-Box LLMs Automaticallycited by 619
  20. 2023AgentVerse: Facilitating Multi-Agent Collaboration and Exploring Emergent Behaviorscited by 580
  21. 2023Textbooks Are All You Needcited by 561
  22. 2024How Johnny Can Persuade LLMs to Jailbreak Them: Rethinking Persuasion to Challenge AI Safety by Humanizing LLMscited by 533
  23. 2024StarCoder 2 and The Stack v2: The Next Generationcited by 484
  24. 2022DS-1000: A Natural and Reliable Benchmark for Data Science Code Generationcited by 442
  25. 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 417
  26. 2023Fine-Grained Human Feedback Gives Better Rewards for Language Model Trainingcited by 399
  27. 2022CodeT: Code Generation with Generated Testscited by 369
  28. 2023A Survey of Hallucination in Large Foundation Modelscited by 365
  29. 2023Chameleon: Plug-and-Play Compositional Reasoning with Large Language Modelscited by 352
  30. 2023Check Your Facts and Try Again: Improving Large Language Models with External Knowledge and Automated Feedbackcited by 351
  31. 2022CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learningcited by 342
  32. 2024Hallucination is Inevitable: An Innate Limitation of Large Language Modelscited by 329
  33. 2023CodeT5+: Open Code Large Language Models for Code Understanding and Generationcited by 327
  34. 2023Principle-Driven Self-Alignment of Language Models from Scratch with Minimal Human Supervisioncited by 318
  35. 2022Generating Sequences by Learning to Self-Correctcited by 271
  36. 2023Self-collaboration Code Generation via ChatGPTcited by 255
  37. 2023Pretraining Language Models with Human Preferencescited by 245
  38. 2020IntelliCode Compose: Code Generation Using Transformercited by 225

50 most cited of 74 All 74 (JSON)

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 1; 2025: 5; 2026: 1.

7 papers.