Research exploring how small LLMs can autonomously enhance their own research and reasoning capabilities by generating, researching, and answering self-created question-answer pairs, learning agentic search via reinforcement learning. All running on a single RTX 4090!
Credits: This project was built using Unsloth's Efficient GRPO code, and adds support for function calling and agentic loops.

After just 100 steps of GRPO training (1 hour on a single RTX 4090 GPU), Llama-8B significantly improved its ability to research and answer questions from the Apollo 13 mission report.
On a validation set of 68 questions, accuracy more than doubled from 23% to 59%.
At the start of training, the model frequently misused the search tool, often:
Through training, however, the model learned to reason and search effectively. It began issuing well-formed queries, refining its searches based on partial results, and successfully retrieving accurate answers.
The following example demonstrates this learned adaptive search behavior after training.
What was the reason for substituting the backup Command Module Pilot 3 days prior to the Apollo 13 flight?
Query : "Apollo 13 Command Module Pilot substitution"
Query : "Apollo 13 Command Module Pilot substitution reason"
Query : "Apollo 13 John 'Jack' Swigert substitution"
Query : "Apollo 13 Jack Swigert illness substitution"
The original Command Module Pilot lacked immunity to measles, necessitating his replacement by Jack Swigert.
This example shows how llama learns to do multiple searches to find answers to its questions.
pip install -r requirements.txt
Begin by generating the embeddings, questions, and answers:
python generate_data.py # Generate QA pairs and embeddings for your documents
Now, run autodidact.ipynb and watch your research agent learn!
generate_data.py – Automates QA pair generation and indexing.search_module.py – Enables semantic search over document corpus.embeddings.py – Manages document/query embedding generation.rl_helpers.py – Controls agent interactions and reward logic.autodidact.ipynb – Full training pipeline example.Replace the existing Apollo 13 mission report (data/mission_report.md) with your own markdown file. Then, rerun:
python generate_data.py
This will generate new question-answer pairs and build a search index, allowing you to train a research agent on any dataset.
Jupyter Notebook
88.0%
Python
12.0%
Research exploring how small LLMs can autonomously enhance their own research and reasoning capabilities by generating, researching, and answering self-created question-answer pairs, learning agentic search via reinforcement learning. All running on a single RTX 4090!
Credits: This project was built using Unsloth's Efficient GRPO code, and adds support for function calling and agentic loops.

After just 100 steps of GRPO training (1 hour on a single RTX 4090 GPU), Llama-8B significantly improved its ability to research and answer questions from the Apollo 13 mission report.
On a validation set of 68 questions, accuracy more than doubled from 23% to 59%.
At the start of training, the model frequently misused the search tool, often:
Through training, however, the model learned to reason and search effectively. It began issuing well-formed queries, refining its searches based on partial results, and successfully retrieving accurate answers.
The following example demonstrates this learned adaptive search behavior after training.
What was the reason for substituting the backup Command Module Pilot 3 days prior to the Apollo 13 flight?
Query : "Apollo 13 Command Module Pilot substitution"
Query : "Apollo 13 Command Module Pilot substitution reason"
Query : "Apollo 13 John 'Jack' Swigert substitution"
Query : "Apollo 13 Jack Swigert illness substitution"
The original Command Module Pilot lacked immunity to measles, necessitating his replacement by Jack Swigert.
This example shows how llama learns to do multiple searches to find answers to its questions.
pip install -r requirements.txt
Begin by generating the embeddings, questions, and answers:
python generate_data.py # Generate QA pairs and embeddings for your documents
Now, run autodidact.ipynb and watch your research agent learn!
generate_data.py – Automates QA pair generation and indexing.search_module.py – Enables semantic search over document corpus.embeddings.py – Manages document/query embedding generation.rl_helpers.py – Controls agent interactions and reward logic.autodidact.ipynb – Full training pipeline example.Replace the existing Apollo 13 mission report (data/mission_report.md) with your own markdown file. Then, rerun:
python generate_data.py
This will generate new question-answer pairs and build a search index, allowing you to train a research agent on any dataset.
Jupyter Notebook
88.0%
Python
12.0%