Update README.md
Browse files
README.md
CHANGED
@@ -2,198 +2,110 @@
|
|
2 |
library_name: transformers
|
3 |
tags: []
|
4 |
---
|
|
|
5 |
|
6 |
-
#
|
7 |
|
8 |
-
<!-- Provide a quick summary of what the model is/does. -->
|
9 |
|
|
|
10 |
|
|
|
11 |
|
12 |
-
## Model Details
|
13 |
|
14 |
-
|
15 |
|
16 |
-
|
17 |
|
18 |
-
|
|
|
19 |
|
20 |
-
|
21 |
-
- **Funded by [optional]:** [More Information Needed]
|
22 |
-
- **Shared by [optional]:** [More Information Needed]
|
23 |
-
- **Model type:** [More Information Needed]
|
24 |
-
- **Language(s) (NLP):** [More Information Needed]
|
25 |
-
- **License:** [More Information Needed]
|
26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
27 |
|
28 |
-
|
29 |
|
30 |
-
|
|
|
31 |
|
32 |
-
|
33 |
-
- **Paper [optional]:** [More Information Needed]
|
34 |
-
- **Demo [optional]:** [More Information Needed]
|
35 |
|
36 |
-
|
|
|
37 |
|
38 |
-
|
39 |
|
40 |
-
|
|
|
|
|
|
|
41 |
|
42 |
-
|
43 |
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
|
46 |
-
|
47 |
|
48 |
-
|
49 |
|
50 |
-
|
51 |
|
52 |
-
|
|
|
53 |
|
54 |
-
|
55 |
|
56 |
-
[
|
|
|
57 |
|
58 |
-
|
|
|
|
|
|
|
|
|
59 |
|
60 |
-
|
61 |
|
62 |
-
[
|
63 |
|
64 |
-
|
65 |
|
66 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
67 |
|
68 |
-
|
69 |
|
70 |
-
|
71 |
|
72 |
-
|
|
|
|
|
73 |
|
74 |
-
|
75 |
|
76 |
-
|
|
|
|
|
77 |
|
78 |
-
|
|
|
|
|
79 |
|
80 |
-
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
81 |
|
82 |
-
|
83 |
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
#### Training Hyperparameters
|
94 |
-
|
95 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
96 |
-
|
97 |
-
#### Speeds, Sizes, Times [optional]
|
98 |
-
|
99 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
100 |
-
|
101 |
-
[More Information Needed]
|
102 |
-
|
103 |
-
## Evaluation
|
104 |
-
|
105 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
106 |
-
|
107 |
-
### Testing Data, Factors & Metrics
|
108 |
-
|
109 |
-
#### Testing Data
|
110 |
-
|
111 |
-
<!-- This should link to a Dataset Card if possible. -->
|
112 |
-
|
113 |
-
[More Information Needed]
|
114 |
-
|
115 |
-
#### Factors
|
116 |
-
|
117 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
118 |
-
|
119 |
-
[More Information Needed]
|
120 |
-
|
121 |
-
#### Metrics
|
122 |
-
|
123 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
124 |
-
|
125 |
-
[More Information Needed]
|
126 |
-
|
127 |
-
### Results
|
128 |
-
|
129 |
-
[More Information Needed]
|
130 |
-
|
131 |
-
#### Summary
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
## Model Examination [optional]
|
136 |
-
|
137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
138 |
-
|
139 |
-
[More Information Needed]
|
140 |
-
|
141 |
-
## Environmental Impact
|
142 |
-
|
143 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
144 |
-
|
145 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
146 |
-
|
147 |
-
- **Hardware Type:** [More Information Needed]
|
148 |
-
- **Hours used:** [More Information Needed]
|
149 |
-
- **Cloud Provider:** [More Information Needed]
|
150 |
-
- **Compute Region:** [More Information Needed]
|
151 |
-
- **Carbon Emitted:** [More Information Needed]
|
152 |
-
|
153 |
-
## Technical Specifications [optional]
|
154 |
-
|
155 |
-
### Model Architecture and Objective
|
156 |
-
|
157 |
-
[More Information Needed]
|
158 |
-
|
159 |
-
### Compute Infrastructure
|
160 |
-
|
161 |
-
[More Information Needed]
|
162 |
-
|
163 |
-
#### Hardware
|
164 |
-
|
165 |
-
[More Information Needed]
|
166 |
-
|
167 |
-
#### Software
|
168 |
-
|
169 |
-
[More Information Needed]
|
170 |
-
|
171 |
-
## Citation [optional]
|
172 |
-
|
173 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
174 |
-
|
175 |
-
**BibTeX:**
|
176 |
-
|
177 |
-
[More Information Needed]
|
178 |
-
|
179 |
-
**APA:**
|
180 |
-
|
181 |
-
[More Information Needed]
|
182 |
-
|
183 |
-
## Glossary [optional]
|
184 |
-
|
185 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
186 |
-
|
187 |
-
[More Information Needed]
|
188 |
-
|
189 |
-
## More Information [optional]
|
190 |
-
|
191 |
-
[More Information Needed]
|
192 |
-
|
193 |
-
## Model Card Authors [optional]
|
194 |
-
|
195 |
-
[More Information Needed]
|
196 |
-
|
197 |
-
## Model Card Contact
|
198 |
-
|
199 |
-
[More Information Needed]
|
|
|
2 |
library_name: transformers
|
3 |
tags: []
|
4 |
---
|
5 |
+

|
6 |
|
7 |
+
# II-Search-CIR 4B
|
8 |
|
|
|
9 |
|
10 |
+
Inspired by the success of our [II-Researcher](https://ii.inc/web/blog/post/ii-researcher) approach, which applies tools with augmented reasoning on top of the [Deep-seek-R1](https://huggingface.co/deepseek-ai/DeepSeek-R1-0528) model, II-Search-4B-CIR introduces Code-Integrated Reasoning (CIR), a more powerful and flexible method for tool interaction with the reasoning process.
|
11 |
|
12 |
+

|
13 |
|
|
|
14 |
|
15 |
+
# Model Description
|
16 |
|
17 |
+
## Code Integrated Reasoning
|
18 |
|
19 |
+
We instruct the model to generate code blocks enclosed between `<start_code>\n```python` and
|
20 |
+
`\n```<end_code>` , within which it can invoke a set of predefined functions.
|
21 |
|
22 |
+
These functions act as interfaces to external resources, similar to the tool call paradigm but offering greater flexibility and control. This approach enables the model to not only retrieve external information but also process, filter, and reason over it programmatically within the code itself.
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
+
In our setup, we provide two predefined functions:
|
25 |
|
26 |
+
- `web_search(query: str, num_result: int)`
|
27 |
+
- `web_visit(url: str)`
|
28 |
|
29 |
+
## Training Methodology
|
|
|
|
|
30 |
|
31 |
+
In our early experiments, we found that even large models such as [Qwen/Qwen3-235B-A22B](https://huggingface.co/Qwen/Qwen3-235B-A22B) or [Deep-seek-R1](https://huggingface.co/deepseek-ai/DeepSeek-R1-0528) could not produce the code format efficiently. Sometimes, models would not use any code blocks at all, instead relying on their internal knowledge base to answer the query.
|
32 |
+
To address this issue, we first curated a dataset and performed SFT fine-tuning on the [Qwen/Qwen3-4B](https://huggingface.co/Qwen/Qwen3-4B) model. Following this, we further optimized the SFT model by training DAPO on a hard-reasoning dataset to boost performance.
|
33 |
|
34 |
+
For SFT stage we using the hyperparameters:
|
35 |
|
36 |
+
- Max Length: 26000.
|
37 |
+
- Batch Size: 128.
|
38 |
+
- Learning-Rate: 1e-5.
|
39 |
+
- Number Of Epoch: 4.
|
40 |
|
41 |
+
For RL stage we setup training with:
|
42 |
|
43 |
+
- Max prompt length: 3000 tokens.
|
44 |
+
- Max response length: 16384 tokens.
|
45 |
+
- Max Total length: 32768 tokens.
|
46 |
+
- Max Observation Length: 3000 tokens per observation.
|
47 |
+
- Masking Observation Tokens: True
|
48 |
+
- Max n.o code blocks: 32.
|
49 |
+
- Clip ratios: Low 0.2, High 0.3.
|
50 |
+
- Batch sizes: Train prompt 128, Generation prompt 128, Mini-batch 16.
|
51 |
+
- Responses per prompt: 16.
|
52 |
+
- Temperature: 1.0, Top-p: 1.0, Top-k: -1 (vLLM rollout).
|
53 |
+
- Learning rate: 1e-6, Warmup steps: 20.
|
54 |
+
- Loss aggregation: Token-mean.
|
55 |
+
- Gradient clipping: 1.0.
|
56 |
|
57 |
+
We describe more detail of our training methodology in our [II-Search-4B](https://ii.inc/web/blog/post/ii-search) blog post
|
58 |
|
59 |
+
## Datasets
|
60 |
|
61 |
+
We also release our dataset to reproduce the results:
|
62 |
|
63 |
+
- [II-Search-CIR-SFT](https://huggingface.co/datasets/Intelligent-Internet/II-Search-CIR-SFT)
|
64 |
+
- [II-Search-RL](https://huggingface.co/datasets/Intelligent-Internet/II-Search-RL)
|
65 |
|
66 |
+
# Evaluation Results
|
67 |
|
68 |
+
We compare our model with other small-sized open-source models, including Qwen3-4B (the model on which we are based) and other models that also specialize in information-seeking tasks. [Qwen3-4B](https://huggingface.co/Qwen/Qwen3-4B), [Jan-4B](https://huggingface.co/Menlo/Jan-nano-128k), [WebSailor-3B](https://huggingface.co/Alibaba-NLP/WebSailor-3B). We also reported the benchmarking results on Google Frames dataset from 2 latest MoE models [Qwen3-30B-A3B-Instruct-2507](https://huggingface.co/Qwen/Qwen3-30B-A3B-Instruct-2507) and [Qwen3-30B-A3B-Thinking-2507](https://huggingface.co/Qwen/Qwen3-30B-A3B-Thinking-2507) on this task.
|
69 |
+
The search API was SerpDev, Google Gemini Pro 2.5 was used to extract and judge the answers (Using the proper judge prompt from the each benchmarking dataset’s author).
|
70 |
|
71 |
+
| **Benchmark** | **Qwen3-4B** | **Jan-4B** | **WebSailor-3B** | **II-Search-4B** | **II-Search-CIR-4B** |
|
72 |
+
| --- | --- | --- | --- | --- | --- |
|
73 |
+
| OpenAI/SimpleQA | 76.8 | 80.1 | 81.8 | 91.8 | 91.8 |
|
74 |
+
| Google/Frames | 30.7 | 24.8 | 34.0 | 67.5 | 72.2 |
|
75 |
+
| Seal_0 | 6.31 | 2.7 | 1.8 | 22.5 | 26.4 |
|
76 |
|
77 |
+
**Note**: Our MCP ensure that we didn't go to any url come from the huggingface when we evaluate the II-Search-CIR-4B model.
|
78 |
|
79 |
+
All benchmark traces from models can be found at:[Inspect-Search-Models-Benchmarking-Result ](https://huggingface.co/datasets/II-Vietnam/Inspect-Search-Models-Benchmarking-Result).
|
80 |
|
81 |
+
# How To Use
|
82 |
|
|
|
83 |
|
84 |
+
Our model can be utilized in the same manner as Qwen or Deepseek-R1-Distill models.
|
85 |
|
86 |
+
For instance, you can easily start a service using [vLLM](https://github.com/vllm-project/vllm):
|
87 |
|
88 |
+
```bash
|
89 |
+
vllm serve Intelligent-Internet/II-Search-CIR-4B --rope-scaling '{"rope_type":"yarn","factor":4.0,"original_max_position_embeddings":32768}'
|
90 |
+
```
|
91 |
|
92 |
+
You can also easily start a service using [SGLang](https://github.com/sgl-project/sglang):
|
93 |
|
94 |
+
```bash
|
95 |
+
python -m sglang.launch_server --model Intelligent-Internet/II-Search-CIR-4B --json-model-override-args '{"rope_scaling":{"rope_type":"yarn","factor":4.0,"original_max_position_embeddings":32768}}' --context-length 128000
|
96 |
+
```
|
97 |
|
98 |
+
To try out the II-SEARCH-CIR model, refer to the example provided in the GitHub repo here:
|
99 |
+
|
100 |
+
👉 [II-Researcher CIR-4B Example](https://github.com/Intelligent-Internet/ii-researcher/tree/main/examples/ii_search_4b)
|
101 |
|
|
|
102 |
|
103 |
+
## Citation
|
104 |
|
105 |
+
```bib
|
106 |
+
@misc{2025II-Search-4B,
|
107 |
+
title={II-Search-4B: Search Reasoning Model},
|
108 |
+
author={Intelligent Internet},
|
109 |
+
year={2025}
|
110 |
+
}
|
111 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|