This notebook demonstrates how to set up and leverage CAMEL’s reward model to evaluate and filter synthetic data. In this notebook, you’ll explore:
- CAMEL: A powerful multi-agent framework that enables data synthesis, evaluation, and model training, as well as multi-agent role-playing scenarios, allowing for sophisticated AI-driven tasks.
- CAMEL FireCrawl Reader: The Firecrawl loader encapsulated in CAMEL allows users to retrieve web information through Firecrawl.
- Reward Model Module: A critical component designed to score and evaluate the quality of generated data based on predefined criteria. It supports fine-tuning of the evaluation process and ensures alignment with desired outcomes, making it an essential tool for filtering synthetic data effectively.

📦 Installation
First, install the CAMEL package with its dependencies🚀 Data Generation
Next, we define our data generation function. It takes a source content and generates a list of instruction-input-response triplets based on it. Later, we will use a reward model to filter this list.📊 Point to content and generate data!
Now we point to the content that we wish to generate SFT data around and use CAMEL’s Firecrawl integration to get this content in a nice markdown format.🔄 Code for Conversion to Reward Model Format
Next, we transform the Alpaca-style entries into a format compatible with the reward model. Each entry will be converted into a structured list of instruction-input-response pairs that the reward model can evaluate.✨Test Reward Model
Then, we can test the reward model to check its output format and use it as a reference to set the filtering criteria.🎯Filtering the Generated Data Using the Reward Model
Finally, we utilize NVIDIA’s Nemotron Reward Model to filter out low-quality instruction-input-response triplets. The model evaluates each response based on defined thresholds for metrics such as helpfulness and correctness. Let’s use thresholds ={"helpfulness": 2.5, "correctness": 2.5} as an example of filter parameters. After filtering, some high-quality triplets are retained.
🌟 Highlights
That’s everything: Got questions about 🐫 CAMEL-AI? Join us on Discord! Whether you want to share feedback, explore the latest in multi-agent systems, get support, or connect with others on exciting projects, we’d love to have you in the community! 🤝 Summary of This Cookbook: In this cookbook, we demonstrated how to leverage CAMEL-AI to filter generate data. This practical guide helps you efficiently evaluate synthetic data. Check out some of our other work:- 🐫 Creating Your First CAMEL Agent free Colab
- 🔥 3 ways to ingest data from websites with Firecrawl & CAMEL free Colab
- 🦥 Agentic SFT Data Generation with CAMEL and Mistral Models, Fine-Tuned with Unsloth free Colab

