mlsanityData to 13 Oct 2026

Unlocking a New Rust Programming Experience: Fast and Slow Thinking with LLMs to Conquer Undefined Behaviors

arXiv 2503.02335 ↗First posted 4 Mar 2025cs.SE cs.CLcited by 0

On the map: LLM reasoning → Reasoning for agents, planning and code

Abstract (arXiv)

To provide flexibility and low-level interaction capabilities, the unsafe tag in Rust is essential in many projects, but undermines memory safety and introduces Undefined Behaviors (UBs) that reduce safety. Eliminating these UBs requires a deep understanding of Rust's safety rules and strong typing. Traditional methods require depth analysis of code, which is laborious and depends on knowledge design. The powerful semantic understanding capabilities of LLM offer new opportunities to solve this problem. Although existing large model debugging frameworks excel in semantic tasks, limited by fixed processes and lack adaptive and dynamic adjustment capabilities. Inspired by the dual process theory of decision-making (Fast and Slow Thinking), we present a LLM-based framework called RustBrain that automatically and flexibly minimizes UBs in Rust projects. Fast thinking extracts features to generate solutions, while slow thinking decomposes, verifies, and generalizes them abstractly. To apply verification and generalization results to solution generation, enabling dynamic adjustments and precise outputs, RustBrain integrates two thinking through a feedback mechanism. Experimental results on Miri dataset show a 94.3% pass rate and 80.4% execution rate, improving flexibility and Rust projects safety.

Key facts. No citing papers in the map yet (data through 13 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 12 of its 37 references that are in the map. First posted on arXiv 4 Mar 2025.

Builds on

12 of 37 references.

References · 12

  1. 2023A Survey of Hallucination in Large Foundation Modelscited by 367
  2. 2024Don't Hallucinate, Abstain: Identifying LLM Knowledge Gaps via Multi-LLM Collaborationcited by 179
  3. 2024The Effect of Sampling Temperature on Problem Solving in Large Language Modelscited by 170
  4. 2023Head-to-Tail: How Knowledgeable are Large Language Models (LLMs)? A.K.A. Will LLMs Replace Knowledge Graphs?cited by 168
  5. 2023Hallucination Augmented Contrastive Learning for Multimodal Large Language Modelcited by 120
  6. 2020Thinking Fast and Slow in AIcited by 68
  7. 2017Thinking Fast and Slow: Optimization Decomposition Across Timescalescited by 60
  8. 2023Explainable Automated Debugging via Large Language Model-driven Scientific Debuggingcited by 40
  9. 2024MEIC: Re-thinking RTL Debug Automation using LLMscited by 25
  10. 2021Thinking Fast and Slow in AI: the Role of Metacognitioncited by 11
  11. 2024Toward Adaptive Reasoning in Large Language Models with Thought Rollbackcited by 11
  12. 2021SafeDrop: Detecting Memory Deallocation Bugs of Rust Programs via Static Data-Flow Analysiscited by 3

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2026AkiraRust: Re-thinking LLM-aided Rust Repair Using a Feedback-guided Thinking Switch
  2. 2026Fine-Tuning Qwen3-27B for C-to-Rust Code Translation: A Three-Stage Curriculum of Pretraining, Debugging-Aware SFT, and Task-Specific SFT
  3. 2025CoRe: Benchmarking LLMs Code Reasoning Capabilities through Static Analysis Tasks
  4. 2026Evaluating and Improving Automated Repository-Level Rust Issue Resolution with LLM-based Agents
  5. 2025RustEvo^2: An Evolving Benchmark for API Evolution in LLM-based Rust Code Generation
  6. 2026Towards Reliable C-to-Rust Translation with Rule-Guided Reasoning and Reinforcement Learning
  7. 2026KVerus: Scalable and Resilient Formal Verification Proof Generation for Rust Code
  8. 2025Beyond Code Generation: LLM-supported Exploration of the Program Design Space