{"id":31756538,"url":"https://github.com/radinch/system2-reasoning-ai","last_synced_at":"2026-05-14T21:35:19.534Z","repository":{"id":318279702,"uuid":"1070609840","full_name":"radinch/System2-Reasoning-AI","owner":"radinch","description":"Experiments on System 2 reasoning — neuro-symbolic learning, inference-time scaling, LLM agents, RL post-training in LLMs, and Graph-based retrieval.","archived":false,"fork":false,"pushed_at":"2025-10-06T08:30:06.000Z","size":3261,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-06T09:38:53.284Z","etag":null,"topics":["graph-rag","inference-time-scaling","llm-agents","neurosymbolic-ai","reinforcement-learning","symbolic-regression","system2-reasoning"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/radinch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-06T07:35:11.000Z","updated_at":"2025-10-06T08:30:09.000Z","dependencies_parsed_at":"2025-10-06T09:38:58.882Z","dependency_job_id":null,"html_url":"https://github.com/radinch/System2-Reasoning-AI","commit_stats":null,"previous_names":["radinch/system2-reasoning-ai"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/radinch/System2-Reasoning-AI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radinch%2FSystem2-Reasoning-AI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radinch%2FSystem2-Reasoning-AI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radinch%2FSystem2-Reasoning-AI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radinch%2FSystem2-Reasoning-AI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/radinch","download_url":"https://codeload.github.com/radinch/System2-Reasoning-AI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radinch%2FSystem2-Reasoning-AI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001981,"owners_count":26083243,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graph-rag","inference-time-scaling","llm-agents","neurosymbolic-ai","reinforcement-learning","symbolic-regression","system2-reasoning"],"created_at":"2025-10-09T19:19:10.164Z","updated_at":"2025-10-09T19:19:11.798Z","avatar_url":"https://github.com/radinch.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# System 2 Reasoning AI\n**Experiments on deliberate, interpretable reasoning across neuro-symbolic models, symbolic regression, inference-time scaling, LLM agents, RL post-training in LLMs, and graph-based retrieval.**\n\n---\n\n## 🧩 Overview\nThis repository gathers six advanced projects exploring how modern AI systems can perform **System 2–style reasoning** — deliberate, structured, and interpretable decision‑making that combines neural and symbolic approaches. Each notebook represents a distinct yet complementary direction toward **explainable, compositional, and multi‑step reasoning**.\n\nThe work spans topics from **neuro‑symbolic program induction** and **symbolic regression** to **inference‑time reasoning optimization**, **reinforcement learning post‑training for LLMs**, **vision‑based LLM agents**, and **GraphRAG‑style retrieval**.\n\n---\n\n## 📚 Contents\n\n| # | Project | Path | Description |\n|---|--------|------|-------------|\n| 1 | **Neuro‑Symbolic Reasoning** | `neuro_symbolic_reasoning/neuro_symbolic_reasoning.ipynb` | CLEVR question answering via program induction, symbolic execution, and seq2seq models (LSTM + Transformer). |\n| 2 | **Symbolic Regression** | `symbolic_regression/symbolic_regression.ipynb` | Equation discovery with Equation Learner (EQL) layers and a Transformer Seq2Seq model (token vocabulary → SymPy expressions). |\n| 3 | **Inference‑Time Scaling** | `inference_time_scaling/inference_time_scaling.ipynb` | Compares Chain‑of‑Thought, Best‑of‑N, Beam Search, Self‑Refine, Tree‑of‑Thoughts, A*, and MCTS on math reasoning. |\n| 4 | **RL Post‑Training for LLMs** | `rl_post_training/rl_post_training.ipynb` | Two‑stage fine‑tuning (SFT → GRPO/TRL) with custom rewards for structure (`\u003cthink\u003e…\u003c/think\u003e` \u0026 `\u003canswer\u003e…\u003c/answer\u003e`) and correctness. |\n| 5 | **Vision LLM Agent** | `vision_llm_agent/vision_llm_agent.ipynb` | Multi‑agent vision reasoning combining OpenCV heuristics with a VLM (Qwen‑VL). Includes ablations and a small 100‑image dataset. |\n| 6 | **GraphRAG Pipeline** | `graph_rag/graph_rag.ipynb` | Graph‑based retrieval and community reasoning with entity extraction, Leiden community detection, and community‑scoped answering. |\n\n---\n\n## 🎯 Core Themes\n- **System 2 Reasoning:** deliberate, multi‑step problem solving  \n- **Hybrid Neuro‑Symbolic Learning:** combining neural inference with symbolic structure  \n- **Reasoning‑Time Optimization:** inference‑time scaling, beam search, and ToT/MCTS exploration  \n- **Reinforcement Learning Post‑Training:** reward shaping for structured reasoning in LLMs  \n- **LLM Agents \u0026 Vision Integration:** combining perception with reasoning chains  \n- **Graph‑Based Retrieval:** leveraging community structure for contextual memory  \n\n---\n\n## ⚙️ Repository Structure\n```\nSystem2-Reasoning-AI\n│   .gitignore\n│   LICENSE\n│   README.md\n│\n├── graph_rag\n│   └── graph_rag.ipynb\n│\n├── inference_time_scaling\n│   └── inference_time_scaling.ipynb\n│\n├── neuro_symbolic_reasoning\n│   │   neuro_symbolic_reasoning.ipynb\n│   │   prompt_example.txt\n│   │\n│   ├── dataH5Files\n│   │   └── (dataset files)\n│   │\n│   └── utils\n│       ├── clevr_executor.py\n│       ├── logger.py\n│       ├── preprocess.py\n│       ├── preprocess_questions.py\n│       ├── programs.py\n│       ├── utils.py\n│       └── __init__.py\n│\n├── rl_post_training\n│   └── rl_post_training.ipynb\n│\n├── symbolic_regression\n│   ├── dataset.csv\n│   └── symbolic_regression.ipynb\n│\n└── vision_llm_agent\n    │   vision_llm_agent.ipynb\n    │\n    └── agent_data\n        │   data.csv\n        │\n        └── images\n            ├── 1018.png\n            ├── 10461.png\n            ├── 10546.png\n            ├── 10916.png\n            ├── 11286.png\n            ├── ...\n            └── 9588.png\n\n```\n\nEach folder contains an independent Jupyter notebook and (where applicable) the supporting data included in your upload.\n\n---\n\n## Environment Setup\n\u003e These notebooks target Python 3.10+. Install only what you need for the notebook you plan to run.\n\n```bash\npip install torch transformers accelerate datasets tqdm numpy matplotlib pandas sympy scikit-learn             trl peft vllm opencv-python pillow             langchain langchain-community langchain-graphrag networkx cdlib pypdf\n```\n**Notes**\n- Some parts (e.g., RL post‑training and GraphRAG community detection) benefit from a **GPU** runtime.  \n- If using verifier or external API calls in the inference‑time scaling notebook, configure your **API keys via environment variables** instead of hard‑coding.\n\n---\n\n## 📊 Selected Observations\n- **Vision LLM Agent:** In the provided ablations, the best deep‑agent configuration (Agent 1 + Agent 3) outperformed zero‑shot and classic pipelines on the 100‑image set.  \n- **Inference‑Time Scaling:** Search‑based and verification‑based strategies (e.g., Best‑of‑N, ToT/MCTS) showed higher accuracy than plain CoT at additional compute cost.  \n- **RL Post‑Training for LLMs:** GRPO with structured rewards improved format compliance and answer correctness relative to SFT‑only baselines.  \n- **GraphRAG:** Community summaries derived from the entity‑relation graph improved long‑document question answering quality relative to naive chunk retrieval.\n\n*(Exact metrics depend on runtime settings and hardware; see notebook outputs for details.)*\n\n---\n\n## Motivation\nSystem 1 reasoning in LLMs is fast but often shallow. This project explores **System 2 reasoning** — deliberate, symbolic, and interpretable — by experimenting with architectures and training strategies that encourage models to reason, plan, and reflect.\n\n---\n\n## Citation\nIf you use this repository in your research, please cite it as follows:\n\n```bibtex\n@misc{System2-Reasoning-AI,\n  author       = {[Radin Cheraghi/SUT]},\n  title        = {Experiments on System 2 reasoning},\n  year         = {2025},\n  publisher    = {GitHub},\n  journal      = {GitHub repository},\n  howpublished = {\\url{https://github.com/radinch/System2-Reasoning-AI.git}}\n}","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fradinch%2Fsystem2-reasoning-ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fradinch%2Fsystem2-reasoning-ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fradinch%2Fsystem2-reasoning-ai/lists"}