Showing LLM-Generated Code Selectively Based on Confidence of LLMs
Jia Li, Yuqi Zhu, Yongmin Li, Ge Li, Zhi Jin

TL;DR
This paper introduces HonestCoder, a confidence-based approach for selectively displaying LLM-generated code to developers, improving correctness estimation and reducing erroneous code exposure with minimal overhead.
Contribution
HonestCoder is a novel method that estimates LLM confidence via multi-modal similarity, enabling selective code display and improving reliability in code generation tasks.
Findings
HonestCoder outperforms state-of-the-art in confidence estimation metrics.
It reduces erroneous code shown to developers significantly.
The approach incurs minimal time overhead (~0.4 seconds per requirement).
Abstract
Large Language Models (LLMs) have shown impressive abilities in code generation, but they may generate erroneous programs. Reading a program takes ten times longer than writing it. Showing these erroneous programs to developers will waste developers' energies and introduce security risks to software. To address the above limitations, we propose HonestCoder, a novel LLM-based code generation approach. HonestCoder selectively shows the generated programs to developers based on LLMs' confidence. The confidence provides valuable insights into the correctness of generated programs. To achieve this goal, we propose a novel approach to estimate LLMs' confidence in code generation. It estimates confidence by measuring the multi-modal similarity between LLMs-generated programs. We collect and release a multilingual benchmark named TruthCodeBench, which consists of 2,265 samples and covers…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsDigital Rights Management and Security · Natural Language Processing Techniques · Mathematics, Computing, and Information Processing
