Run this model with HF Jobs
Run Zesearch/Zevo-Legal-L4 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/Zesearch/Zevo-Legal-L4. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Zesearch/Zevo-Legal-L4 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/Zesearch/Zevo-Legal-L4. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/Zesearch/Zevo-Legal-L4. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use Zesearch/Zevo-Legal-L4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Zesearch/Zevo-Legal-L4 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-8B") model = PeftModel.from_pretrained(base_model, "Zesearch/Zevo-Legal-L4") - Notebooks
- Google Colab
- Kaggle
Release validation-selected Zevo model with evaluation results and public run link
Browse filesFiles changed (8)
- .gitattributes+1
- README.mdAdded+100
- adapter_config.jsonAdded+50
- adapter_model.safetensorsAdded+3
- chat_template.jinjaAdded+89
- tokenizer.jsonAdded+3
- tokenizer_config.jsonAdded+30
- zevo_evaluation.jsonAdded+25
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines3334353632 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -texttokenizer.json filter=lfs diff=lfs merge=lfs -text
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100---library_name: peftlicense: apache-2.0base_model: Qwen/Qwen3-8Bbase_model_relation: adapterpipeline_tag: text-generationlanguage:- entags:- zevo- legal- text-generation- grpo---
# Zevo-Legal-L4
Zevo-Legal-L4 is a legal model produced by Zevo through autonomous model evolution at autonomy level L4. Zevo chooses the base model, training method, training data, and execution details.
**[Explore the public run](https://console.zevoai.dev/runs/33aa2626-ec50-4e1b-b6c3-271966861ae1?from=public)** · **[Zevo collection](https://huggingface.co/collections/Zesearch/zevo-6b14a9ed6ba099b8ab318b5f)** · **[Legal collection](https://huggingface.co/collections/Zesearch/zevo-legal-6b14a9ed55c6efc2c72165ff)**
## Model information
| Field | Value ||---|---|| Base model | [Qwen/Qwen3-8B](https://huggingface.co/Qwen/Qwen3-8B) || Release format | LoRA adapter || Selected iteration | 15 || Selected-stage training method | GRPO || Run ID | `33aa2626-ec50-4e1b-b6c3-271966861ae1` |
This is the run's retained, validation-selected checkpoint, which need not be its last trained iteration. Test results were evaluated independently and were not used for checkpoint selection.
## Results
Scores below are percentages; suite averages give equal weight to each benchmark within a split. Validation and Test use different evaluation sets and should not be compared as interchangeable scores.
| Metric | Score (%) ||---|---:|| Validation suite average | 56.93 || Test suite average | 60.62 || Initial baseline Test (paper comparison) | 53.86 || Human Ref. Test (paper comparison) | 48.63 |
The baseline and Human Ref. comparison follows the paper tables. Shared initial-model baselines are averaged across their reference evaluations; the flagged Medicine L2 baseline is excluded. L4 uses its selected base model's baseline. Human Ref. denotes a human-designed training reference checkpoint, not human accuracy; comparisons may involve different base models.
### Validation benchmarks
| Benchmark | Score (%) ||---|---:|| MMLU-Law | 54.71 || MMLU-Pro-Law | 39.89 || CaseHOLD | 76.20 |
### Test benchmarks
| Benchmark | Score (%) ||---|---:|| MMLU-Law | 66.56 || MMLU-Pro-Law | 39.82 || CaseHOLD | 75.48 |
## Loading example
Install recent versions of `transformers`, `torch`, `accelerate` and `peft`. This example illustrates loading and generation; benchmark scores require the run's evaluation protocol.
```pythonimport torchfrom transformers import AutoModelForCausalLM, AutoTokenizerfrom peft import PeftModel
repo_id = "Zesearch/Zevo-Legal-L4"tokenizer = AutoTokenizer.from_pretrained(repo_id)base = AutoModelForCausalLM.from_pretrained( "Qwen/Qwen3-8B", torch_dtype="auto", device_map="auto")model = PeftModel.from_pretrained(base, repo_id)model.eval()messages = [ {"role": "system", "content": "You are a legal expert answering multiple-choice questions about law. Identify the governing legal rule or doctrine and apply it to the facts, keeping that analysis to at most four sentences. Then finish your reply with a single final line in exactly this form:\nFinal Answer: X\nReplace X with the letter of the one best option. Write nothing after that line."}, {"role": "user", "content": "Please explain your answer to the following question."},]text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)inputs = tokenizer(text, return_tensors="pt", add_special_tokens=False).to(model.device)with torch.inference_mode(): outputs = model.generate(**inputs, max_new_tokens=512, do_sample=False)print(tokenizer.decode(outputs[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))```
Use the tokenizer and chat template included in this repository. The generation length above is illustrative, not the benchmark-specific output budget.
This repository contains the adapter, not a copy of the base weights. Load the exact base model listed above.
## Intended use and limitations
Released for research on autonomous model evolution. Scores describe the reported evaluation suite and do not establish reliability on arbitrary inputs. Outputs may be incorrect or biased. This model is not a substitute for professional legal judgment.
## License and provenance
Use is subject to the applicable base-model license and terms linked above. The public run provides the experiment journal and training history. This release contains inference weights, tokenizer/configuration files, and evaluation metadata; it excludes optimizer state and internal execution logs.1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950{ "alora_invocation_tokens": null, "alpha_pattern": {}, "arrow_config": null, "auto_mapping": null, "base_model_name_or_path": "Qwen/Qwen3-8B", "bias": "none", "corda_config": null, "ensure_weight_tying": false, "eva_config": null, "exclude_modules": null, "fan_in_fan_out": false, "inference_mode": true, "init_lora_weights": true, "layer_replication": null, "layers_pattern": null, "layers_to_transform": null, "loftq_config": {}, "lora_alpha": 64, "lora_bias": false, "lora_dropout": 0.0, "lora_ga_config": null, "megatron_config": null, "megatron_core": "megatron.core", "modules_to_save": null, "monteclora_config": null, "peft_type": "LORA", "peft_version": "0.20.0", "qalora_group_size": 16, "r": 32, "rank_pattern": {}, "revision": null, "target_modules": [ "gate_proj", "q_proj", "up_proj", "k_proj", "down_proj", "v_proj", "o_proj" ], "target_parameters": null, "task_type": "CAUSAL_LM", "trainable_token_indices": null, "use_bdlora": null, "use_dora": false, "use_qalora": false, "use_rslora": false, "velora_config": null}123version https://git-lfs.github.com/spec/v1oid sha256:08f91bedb5a898d0929bdd02d015a73c42fd0dc2c46fd865af12074443ab95e4size 3492437521234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889{%- if tools %} {{- '<|im_start|>system\n' }} {%- if messages[0].role == 'system' %} {{- messages[0].content + '\n\n' }} {%- endif %} {{- "# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }} {%- for tool in tools %} {{- "\n" }} {{- tool | tojson }} {%- endfor %} {{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}{%- else %} {%- if messages[0].role == 'system' %} {{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }} {%- endif %}{%- endif %}{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}{%- for message in messages[::-1] %} {%- set index = (messages|length - 1) - loop.index0 %} {%- if ns.multi_step_tool and message.role == "user" and message.content is string and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %} {%- set ns.multi_step_tool = false %} {%- set ns.last_query_index = index %} {%- endif %}{%- endfor %}{%- for message in messages %} {%- if message.content is string %} {%- set content = message.content %} {%- else %} {%- set content = '' %} {%- endif %} {%- if (message.role == "user") or (message.role == "system" and not loop.first) %} {{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }} {%- elif message.role == "assistant" %} {%- set reasoning_content = '' %} {%- if message.reasoning_content is string %} {%- set reasoning_content = message.reasoning_content %} {%- else %} {%- if '</think>' in content %} {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %} {%- set content = content.split('</think>')[-1].lstrip('\n') %} {%- endif %} {%- endif %} {%- if loop.index0 > ns.last_query_index %} {%- if loop.last or (not loop.last and reasoning_content) %} {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }} {%- else %} {{- '<|im_start|>' + message.role + '\n' + content }} {%- endif %} {%- else %} {{- '<|im_start|>' + message.role + '\n' + content }} {%- endif %} {%- if message.tool_calls %} {%- for tool_call in message.tool_calls %} {%- if (loop.first and content) or (not loop.first) %} {{- '\n' }} {%- endif %} {%- if tool_call.function %} {%- set tool_call = tool_call.function %} {%- endif %} {{- '<tool_call>\n{"name": "' }} {{- tool_call.name }} {{- '", "arguments": ' }} {%- if tool_call.arguments is string %} {{- tool_call.arguments }} {%- else %} {{- tool_call.arguments | tojson }} {%- endif %} {{- '}\n</tool_call>' }} {%- endfor %} {%- endif %} {{- '<|im_end|>\n' }} {%- elif message.role == "tool" %} {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %} {{- '<|im_start|>user' }} {%- endif %} {{- '\n<tool_response>\n' }} {{- content }} {{- '\n</tool_response>' }} {%- if loop.last or (messages[loop.index0 + 1].role != "tool") %} {{- '<|im_end|>\n' }} {%- endif %} {%- endif %}{%- endfor %}{%- if add_generation_prompt %} {{- '<|im_start|>assistant\n' }} {%- if enable_thinking is defined and enable_thinking is false %} {{- '<think>\n\n</think>\n\n' }} {%- endif %}{%- endif %}123version https://git-lfs.github.com/spec/v1oid sha256:be75606093db2094d7cd20f3c2f385c212750648bd6ea4fb2bf507a6a4c55506size 11422650123456789101112131415161718192021222324252627282930{ "add_prefix_space": false, "backend": "tokenizers", "bos_token": null, "clean_up_tokenization_spaces": false, "eos_token": "<|im_end|>", "errors": "replace", "extra_special_tokens": [ "<|im_start|>", "<|im_end|>", "<|object_ref_start|>", "<|object_ref_end|>", "<|box_start|>", "<|box_end|>", "<|quad_start|>", "<|quad_end|>", "<|vision_start|>", "<|vision_end|>", "<|vision_pad|>", "<|image_pad|>", "<|video_pad|>" ], "is_local": true, "local_files_only": true, "model_max_length": 131072, "pad_token": "<|endoftext|>", "split_special_tokens": false, "tokenizer_class": "Qwen2Tokenizer", "unk_token": null}12345678910111213141516171819202122232425{ "run_id": "33aa2626-ec50-4e1b-b6c3-271966861ae1", "run_url": "https://console.zevoai.dev/runs/33aa2626-ec50-4e1b-b6c3-271966861ae1?from=public", "domain": "Legal", "level": 4, "selected_iteration": 15, "base_model": "Qwen/Qwen3-8B", "training_method": "grpo", "format": "LoRA adapter", "validation_suite_average": 0.5693186666666666, "test_suite_average": 0.6062156666666667, "scores": { "validation": { "MMLU-Law": 0.547059, "MMLU-Pro-Law": 0.398907, "CaseHOLD": 0.76199 }, "test": { "MMLU-Law": 0.665644, "MMLU-Pro-Law": 0.398207, "CaseHOLD": 0.754796 } }, "system_prompt": "You are a legal expert answering multiple-choice questions about law. Identify the governing legal rule or doctrine and apply it to the facts, keeping that analysis to at most four sentences. Then finish your reply with a single final line in exactly this form:\nFinal Answer: X\nReplace X with the letter of the one best option. Write nothing after that line."}.gitattributes+1
README.mdAdded+100
adapter_config.jsonAdded+50
adapter_model.safetensorsAdded+3
chat_template.jinjaAdded+89
tokenizer.jsonAdded+3
tokenizer_config.jsonAdded+30
zevo_evaluation.jsonAdded+25