mlsanityData to 7 Oct 2026

CosmoCore Affective Dream-Replay Reinforcement Learning for Code Generation

arXiv 2510.18895 ↗First posted 20 Oct 2025cs.SE cs.AI cs.HCcited by 1

Not on the map. Why?

Abstract (arXiv)

We introduce CosmoCore, a neuroscience-inspired reinforcement learning (RL) architecture that integrates affective signals to enhance code generation in large language models (LLMs). Motivated by human and animal learning where embarrassment from mistakes drives rapid correction, as observed in training a puppy to avoid repeating errors after a single scolding CosmoCore tags code generation trajectories with valence and surprise using a lightweight multi-layer perceptron (MLP). High-negative valence (cringe) episodes, such as buggy code outputs, are prioritized in a Dream Queue for five-fold replay during off-policy updates, while low-surprise successes are pruned to prevent overconfidence and buffer bloat. Evaluated on code generation benchmarks like HumanEval and BigCodeBench, alongside simulations with a custom data pipeline environment, CosmoCore reduces hallucinated code (e.g., syntax errors or logical bugs) by 48% and accelerates self-correction by 45%. Local experiments using Hugging Face models in a PySpark environment validate these gains, with code snippets provided for replication. Ablations confirm valence tagging boosts curiosity in exploration, and pruning mitigates inefficiency. This framework extends RL from human feedback (RLHF) for more emotionally aware code assistants, with applications in IDEs and data pipelines. Code and the custom mini-world simulation are released.

Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 13 of its 24 references that are in the map. First posted on arXiv 20 Oct 2025.

Builds on

13 of 24 references.

References · 13

  1. 2015Prioritized Experience Replaycited by 1,070
  2. 2022CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learningcited by 342
  3. 2024RLEF: Grounding Code LLMs in Execution Feedback with Reinforcement Learningcited by 146
  4. 2025CodeElo: Benchmarking Competition-level Code Generation of LLMs with Human-comparable Elo Ratingscited by 109
  5. 2022ReCode: Robustness Evaluation of Code Generation Modelscited by 100
  6. 2024StepCoder: Improve Code Generation with Reinforcement Learning from Compiler Feedbackcited by 74
  7. 2025LLM Collaboration With Multi-Agent Reinforcement Learningcited by 47
  8. 2022Actor Prioritized Experience Replaycited by 19
  9. 2025CodeBoost: Boosting Code LLMs by Squeezing Knowledge from Code Snippets with RLcited by 7
  10. 2024A Review of Neuroscience-Inspired Machine Learningcited by 6
  11. 2025Emotions in the Loop: A Survey of Affective Computing for Emotional Supportcited by 5
  12. 2022BIMRL: Brain Inspired Meta Reinforcement Learningcited by 2
1 more
  1. 2025Edge Intelligence with Spiking Neural Networkscited by 2

Built on by

Cited by year

Citing papers per year: 2025: 1.

1 paper.

Similar, not cited

Close in wording, no citation either way

  1. 2026CodeScaler: Scaling Code LLM Training and Test-Time Inference via Reward Models
  2. 2025Self-Correcting Code Generation Using Small Language Models
  3. 2026HARPO: Hallucination-Aware Reinforcement Learning for Faithful and Creative Language Generation
  4. 2024On-Policy Self-Alignment with Fine-grained Knowledge Feedback for Hallucination Mitigation
  5. 2025Cracking the Code of Action: a Generative Approach to Affordances for Reinforcement Learning
  6. 2025Co-Evolving LLM Coder and Unit Tester via Reinforcement Learning
  7. 2025Reinforcement Learning from Compiler and Language Server Feedback
  8. 2026Improving Small Language Models for Code Generation with Reinforcement Learning from Verification Feedback