Skip to main content
CenXiv.org
This website is in trial operation, support us!
We gratefully acknowledge support from all contributors.
Contribute
Donate
cenxiv logo > cs > arXiv:2510.18895

Help | Advanced Search

Computer Science > Software Engineering

arXiv:2510.18895 (cs)
[Submitted on 20 Oct 2025 ]

Title: CosmoCore Affective Dream-Replay Reinforcement Learning for Code Generation

Title: CosmoCore 情感梦境重放强化学习用于代码生成

Authors:Santhosh Kumar Ravindran
Abstract: 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.
Abstract: 我们引入了CosmoCore,这是一种受神经科学启发的强化学习(RL)架构,它整合了情感信号以增强大型语言模型(LLMs)中的代码生成。 受到人类和动物学习的启发,在训练小狗避免在一次责骂后重复错误时观察到的尴尬感驱动快速修正,CosmoCore使用轻量级多层感知机(MLP)对代码生成轨迹进行情感和惊喜度标记。 高负向情感(尴尬)事件,如存在错误的代码输出,在离策略更新期间被优先放入梦境队列中进行五倍重放,而低惊喜的成功则被修剪以防止过度自信和缓冲区溢出。 在代码生成基准测试如HumanEval和BigCodeBench上,以及使用自定义数据管道环境的模拟中进行评估,CosmoCore将幻觉代码(例如语法错误或逻辑错误)减少了48%,并加速了自我修正45%。 在PySpark环境中使用Hugging Face模型进行的本地实验验证了这些改进,并提供了代码片段以供复制。 消融实验确认情感标记增强了探索中的好奇心,而修剪减少了效率低下。 该框架扩展了从人类反馈中学习的强化学习(RLHF),以实现更具情感意识的代码助手,应用于集成开发环境(IDEs)和数据管道。 代码和自定义的小世界模拟已发布。
Comments: 12 pages
Subjects: Software Engineering (cs.SE) ; Artificial Intelligence (cs.AI); Human-Computer Interaction (cs.HC)
Cite as: arXiv:2510.18895 [cs.SE]
  (or arXiv:2510.18895v1 [cs.SE] for this version)
  https://doi.org/10.48550/arXiv.2510.18895
arXiv-issued DOI via DataCite

Submission history

From: Santhosh Kumar Ravindran [view email]
[v1] Mon, 20 Oct 2025 06:50:09 UTC (15 KB)
Full-text links:

Access Paper:

    View a PDF of the paper titled
  • View Chinese PDF
  • View PDF
  • HTML (experimental)
  • TeX Source
license icon view license
Current browse context:
cs.SE
< prev   |   next >
new | recent | 2025-10
Change to browse by:
cs
cs.AI
cs.HC

References & Citations

  • NASA ADS
  • Google Scholar
  • Semantic Scholar
a export BibTeX citation Loading...

BibTeX formatted citation

×
Data provided by:

Bookmark

BibSonomy logo Reddit logo

Bibliographic and Citation Tools

Bibliographic Explorer (What is the Explorer?)
Connected Papers (What is Connected Papers?)
Litmaps (What is Litmaps?)
scite Smart Citations (What are Smart Citations?)

Code, Data and Media Associated with this Article

alphaXiv (What is alphaXiv?)
CatalyzeX Code Finder for Papers (What is CatalyzeX?)
DagsHub (What is DagsHub?)
Gotit.pub (What is GotitPub?)
Hugging Face (What is Huggingface?)
Papers with Code (What is Papers with Code?)
ScienceCast (What is ScienceCast?)

Demos

Replicate (What is Replicate?)
Hugging Face Spaces (What is Spaces?)
TXYZ.AI (What is TXYZ.AI?)

Recommenders and Search Tools

Influence Flower (What are Influence Flowers?)
CORE Recommender (What is CORE?)
IArxiv Recommender (What is IArxiv?)
  • Author
  • Venue
  • Institution
  • Topic

arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.

Which authors of this paper are endorsers? | Disable MathJax (What is MathJax?)
  • About
  • Help
  • contact arXivClick here to contact arXiv Contact
  • subscribe to arXiv mailingsClick here to subscribe Subscribe
  • Copyright
  • Privacy Policy
  • Web Accessibility Assistance
  • arXiv Operational Status
    Get status notifications via email or slack

京ICP备2025123034号