EDGEGEN: Improving Tool-Calling Agents Beyond Happy Paths with Synthetic Edge Case Generation
Organizations: SAP
Abstract
Tool-calling LLM agents are increasingly deployed in enterprise applications. However, effective evaluation and optimization require high-quality, diverse task datasets that are often difficult to obtain due to privacy and other constraints. Existing synthetic task generation methods often produce generic tasks that ignore an agent's underlying state or database and fail to reflect real-world usage diversity. We propose EdgeGen, a synthetic task generation framework that extracts compliance rules from an agent's specification and uses them to generate database-grounded edge-case tasks designed to violate these rules. When combined with existing synthetic data generation techniques, EdgeGen enables agent improvement through finetuning and harness optimization. The resulting pipeline forms a fully automated closed-loop system that requires no human annotation. Finetuning on data generated by EdgeGen yields a consistent mean progress improvement of 2 percent to 42 percent on tau2bench airline domain, while other baseline methods show degradation for some models. On the other hand, for harness optimization, our method shows a mean progress improvement of 10 percent and 30 percent over the human-curated and base harnesses, respectively, for the Gemma-4-e4b model.
Figures & tables
| Model | Base | Human-Curated | Naive | FuncBenchGen | TaskBench | EdgeGen (Ours) |
|---|---|---|---|---|---|---|
| -bench Airline Domain | ||||||
| Qwen2.5-3b | 0.35 | 0.26 | 0.39 0.04 | 0.30 0.04 | 0.34 0.01 | 0.29 0.03 | 0.39 0.04 | 0.34 0.08 | 0.28 0.07 | 0.25 0.01 | 0.39 0.04 | 0.37 0.11 |
| Qwen3.5-4b | 0.89 | 0.76 | 0.90 0.01 | 0.79 0.03 | 0.92 0.03 | 0.79 0.03 | 0.85 0.04 | 0.72 0.04 | 0.87 0.02 | 0.74 0.02 | 0.92 0.03 | 0.79 0.03 |
| Qwen3.5-9b | 0.92 | 0.80 | 0.87 0.05 | 0.78 0.02 | 0.92 0.00 | 0.81 0.01 | 0.92 0.00 | 0.78 0.02 | 0.89 0.03 | 0.78 0.01 | 0.95 0.03 | 0.85 0.05 |
| Qwen3.5-35b | 0.92 | 0.81 | 0.88 0.04 | 0.76 0.05 | 0.84 0.08 | 0.73 0.08 | 0.92 0.00 | 0.79 0.02 | 0.85 0.07 | 0.76 0.05 | 0.92 0.00 | 0.82 0.01 |
| Gemma-4-e4b | 0.66 | 0.43 | 0.69 0.03 | 0.50 0.07 | 0.70 0.04 | 0.48 0.05 | 0.69 0.03 | 0.51 0.08 | 0.70 0.04 | 0.55 0.12 | 0.79 0.13 | 0.56 0.13 |
| Performance | Efficiency | |||
| Harness | Max Prog | Mean Prog | Tools | Tokens |
| Gemma-4-e4b | ||||
| Base | 0.6583 | 0.4301 | 5.8 | 81.0k |
| Opt. (Human-Curated) | 0.8167 | 0.5083 | 8.8 | 121.0k |
| Opt. ( EdgeGen ) | 0.8208 | 0.5608 | 6.9 | 85.0k |
| gpt-5.4 | ||||
| Opt. (Human-Curated) | Opt. ( EdgeGen ) |
| Cancellation requires: 24hr window OR airline cancelled OR business OR insured+covered reason. Flown flights transfer to human. | Before any write operation (book, modify, cancel), verify all policy requirements are met and confirm with the user once. For cancellations, check all four eligibility conditions in the policy. |
| Training Data | Qwen2.5-3B | Qwen3.5-4B |
|---|---|---|
| Base | 0.35 | 0.89 |
| Happy Path | 0.39 0.05 | 0.88 0.01 |
| 1 Violation | 0.67 0.32 | 0.92 0.03 |
| 2 Violations | 0.24 0.10 | 0.90 0.02 |
| 3 Violations | 0.38 0.03 | 0.90 0.02 |
Appendix figures & tables11 assets
Supplementary material from the paper’s appendix.
Appendix
| Cluster | Human | EdgeGen |
|---|---|---|
| Compensation eligibility denial | 0/10 | 4/10 |
| Verify user claims vs. system data | 0/10 | 3/10 |
| Airport / one-stop itinerary lookup | 0/10 | 3/10 |
| Partial-cancellation rejection | 0/10 | 1/10 |
| Tight 24-h cancel-window enforcement | 0/10 | 2/10 |
| Multi-field modification | 5/10 | 2/10 |
| Study A | ||||
|---|---|---|---|---|
| -bench airline | ToolSandbox | |||
| Category | Count | % | Count | % |
| Correct | 6 | 60.0 | 4 | 40.0 |
| Incorrect/Loosely defined assertion | 2 | 20.0 | 2 | 20.0 |
| Judge Error | 1 | 10.0 | 2 | 20.0 |
| Missing Task Details | 1 | 10.0 | 2 | 20.0 |
| Artifact | Type | License / Terms |
|---|---|---|
| -bench ( Barres et al., 2025 ) | Benchmark | MIT |
| ToolSandbox ( Lu et al., 2025 ) | Benchmark | Apple Custom License |
| Qwen 2.5 / 3.5 ( Yang et al., 2024 ; Team, 2024 ; Qwen Team, 2026 ) | Model | Qwen License |
| Gemma 4 ( Google, 2026 ) | Model | Gemma Terms of Use |
| GPT-4.1 / GPT-5.4 | Model (API) | OpenAI Terms of Service |
| EdgeGen (Ours) | Code & Data | Apache 2.0 |
| Model | Total Params | Active Params |
|---|---|---|
| Qwen 2.5-3B | 3.1B | 3.1B |
| Qwen 3.5-4B | 4B | 4B |
| Qwen 3.5-9B | 9B | 9B |
| Qwen 3.5-35B | 35B | 3B |
| Gemma 4-e2b | 2B | 2B |
| Gemma 4-e4b | 4B | 4B |
| Model | LoRA rank | Dropout | Batch size (per device) | |
|---|---|---|---|---|
| Qwen 2.5-3B | 64 | 128 | 0.05 | 2 |
| Qwen 3.5-4B | 64 | 128 | 0.05 | 1 |
| Qwen 3.5-9B | 64 | 128 | 0.05 | 1 |
| Qwen 3.5-35B | 32 | 64 | 0.05 | 1 |
| Gemma 4-e4b | 64 | 128 | 0.05 | 1 |
| Gemma 4-e2b | 64 | 128 | 0.05 | 2 |
| Domain | GT | Extracted | Precision | Recall | F1 |
|---|---|---|---|---|---|
| Airline | 32 | 40 | 90.0% | 87.5% | 88.7% |
| Retail | 21 | 24 | 100.0% | 95.2% | 97.6% |
| ToolSandbox | 10 | 10 | 100.0% | 100.0% | 100.0% |
| Overall | 63 | 74 | 94.6% | 92.1% | 93.3% |
| Comparison | Win rate |
|---|---|
| EdgeGen vs. Base | 100.00% |
| EdgeGen vs. Naive | 81.25% |
| EdgeGen vs. Human-Curated | 86.67% |
| EdgeGen vs. TaskBench | 94.12% |
| EdgeGen vs. FuncBenchGen | 100.00% |
| Harness | Mean | Max | Tokens | Tools |
|---|---|---|---|---|
| Base | 0.910 | 0.983 | 2.5k | 3.0 |
| Opt. (Human-Curated, ) | 0.931 | 0.983 | 2.6k | 3.1 |
| Opt. ( EdgeGen , ) | 0.923 | 0.983 | 4.4k | 3.3 |
| Domain | Method | Gen. tokens | Gen. time (s) | Rejection | Avg. train tokens |
|---|---|---|---|---|---|
| -bench airline | Naive | 16,817 | 0.8 | 30% | 6,567 |
| FuncBenchGen | 3,331 | 5.7 | 50% | 5,971 | |
| TaskBench | 2,176 | 10.9 | 70% | 5,902 | |
| EdgeGen | 22,575 | 144.3 | 0% | 7,909 | |
| -bench retail | Naive | 10,922 | 0.7 | 60% | 7,340 |
| FuncBenchGen | 4,080 | 4.9 | 20% | 5,910 |
| Human-curated test | Synthetic validation | |||
| Training budget | Max progress | Mean progress | Max progress | Mean progress |
| Qwen3.5-4b | ||||
| Base | 0.769 | 0.696 | 0.433 | 0.408 |
| 0.821 | 0.723 | 0.517 | 0.450 | |
| 0.856 | 0.800 | 0.567 | 0.475 | |
| 0.755 | 0.704 | 0.286 | 0.286 | |
| Evaluation set | Training budget | Max progress | Mean progress | Tokens | Tools |
|---|---|---|---|---|---|
| Human-curated test | Base | 0.803 | 0.511 | 55k | 9.0 |
| 0.783 | 0.513 | 109k | 10.6 | ||
| 0.795 | 0.460 | 105k | 10.6 | ||
| 0.725 | 0.463 | 124k | 13.8 | ||
| Synthetic validation | Base | 0.425 | 0.346 | 49k | 8.7 |
| 0.750 | 0.539 | 65k | 17.8 |
Tool-Using Agents
Tool-using agents plan and act through external tools, APIs, software interfaces, and environments to complete tasks beyond language generation.
See all 277 papers