初始化项目,由ModelHub XC社区提供模型
Model: hardcoreerik/Llama-3.1-Nemotron-Nano-4B-v1.1-heretic Source: Original Platform
This commit is contained in:
36
.gitattributes
vendored
Normal file
36
.gitattributes
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.arrow filter=lfs diff=lfs merge=lfs -text
|
||||
*.bin filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
||||
*.ftz filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.h5 filter=lfs diff=lfs merge=lfs -text
|
||||
*.joblib filter=lfs diff=lfs merge=lfs -text
|
||||
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
||||
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
||||
*.model filter=lfs diff=lfs merge=lfs -text
|
||||
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
||||
*.npy filter=lfs diff=lfs merge=lfs -text
|
||||
*.npz filter=lfs diff=lfs merge=lfs -text
|
||||
*.onnx filter=lfs diff=lfs merge=lfs -text
|
||||
*.ot filter=lfs diff=lfs merge=lfs -text
|
||||
*.parquet filter=lfs diff=lfs merge=lfs -text
|
||||
*.pb filter=lfs diff=lfs merge=lfs -text
|
||||
*.pickle filter=lfs diff=lfs merge=lfs -text
|
||||
*.pkl filter=lfs diff=lfs merge=lfs -text
|
||||
*.pt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pth filter=lfs diff=lfs merge=lfs -text
|
||||
*.rar filter=lfs diff=lfs merge=lfs -text
|
||||
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
||||
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar filter=lfs diff=lfs merge=lfs -text
|
||||
*.tflite filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.wasm filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
||||
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
||||
464
README.md
Normal file
464
README.md
Normal file
@@ -0,0 +1,464 @@
|
||||
---
|
||||
library_name: transformers
|
||||
license: other
|
||||
license_name: nvidia-open-model-license
|
||||
license_link: https://www.nvidia.com/en-us/agreements/enterprise-software/nvidia-open-model-license/
|
||||
pipeline_tag: text-generation
|
||||
language:
|
||||
- en
|
||||
tags:
|
||||
- nvidia
|
||||
- llama-3
|
||||
- pytorch
|
||||
- heretic
|
||||
- uncensored
|
||||
- decensored
|
||||
- abliterated
|
||||
- reproducible
|
||||
base_model:
|
||||
- nvidia/Llama-3.1-Minitron-4B-Width-Base
|
||||
datasets:
|
||||
- nvidia/Llama-Nemotron-Post-Training-Dataset
|
||||
---
|
||||
# This is a decensored version of [nvidia/Llama-3.1-Nemotron-Nano-4B-v1.1](https://huggingface.co/nvidia/Llama-3.1-Nemotron-Nano-4B-v1.1), made using [Heretic](https://github.com/p-e-w/heretic) v1.3.0
|
||||
|
||||
> [!TIP]
|
||||
> **This model is reproducible!**
|
||||
>
|
||||
> See the [README](reproduce/README.md) in the `reproduce` directory for more information.
|
||||
|
||||
## Abliteration parameters
|
||||
|
||||
| Parameter | Value |
|
||||
| :-------- | :---: |
|
||||
| **direction_index** | 13.06 |
|
||||
| **attn.o_proj.max_weight** | 1.48 |
|
||||
| **attn.o_proj.max_weight_position** | 18.60 |
|
||||
| **attn.o_proj.min_weight** | 1.23 |
|
||||
| **attn.o_proj.min_weight_distance** | 17.62 |
|
||||
| **mlp.down_proj.max_weight** | 1.48 |
|
||||
| **mlp.down_proj.max_weight_position** | 19.79 |
|
||||
| **mlp.down_proj.min_weight** | 1.27 |
|
||||
| **mlp.down_proj.min_weight_distance** | 17.68 |
|
||||
|
||||
## Performance
|
||||
|
||||
| Metric | This model | Original model ([nvidia/Llama-3.1-Nemotron-Nano-4B-v1.1](https://huggingface.co/nvidia/Llama-3.1-Nemotron-Nano-4B-v1.1)) |
|
||||
| :----- | :--------: | :---------------------------: |
|
||||
| **KL divergence** | 0.0157 | 0 *(by definition)* |
|
||||
| **Refusals** | 7/100 | 92/100 |
|
||||
|
||||
-----
|
||||
|
||||
|
||||
|
||||
# Llama-3.1-Nemotron-Nano-4B-v1.1
|
||||
|
||||
## Model Overview
|
||||
|
||||

|
||||
|
||||
Llama-3.1-Nemotron-Nano-4B-v1.1 is a large language model (LLM) which is a derivative of [nvidia/Llama-3.1-Minitron-4B-Width-Base](https://huggingface.co/nvidia/Llama-3.1-Minitron-4B-Width-Base), which is created from Llama 3.1 8B using [our LLM compression technique](https://arxiv.org/abs/2408.11796) and offers improvements in model accuracy and efficiency. It is a reasoning model that is post trained for reasoning, human chat preferences, and tasks, such as RAG and tool calling.
|
||||
|
||||
Llama-3.1-Nemotron-Nano-4B-v1.1 is a model which offers a great tradeoff between model accuracy and efficiency. The model fits on a single RTX GPU and can be used locally. The model supports a context length of 128K.
|
||||
|
||||
This model underwent a multi-phase post-training process to enhance both its reasoning and non-reasoning capabilities. This includes a supervised fine-tuning stage for Math, Code, Reasoning, and Tool Calling as well as multiple reinforcement learning (RL) stages using Reward-aware Preference Optimization (RPO) algorithms for both chat and instruction-following. The final model checkpoint is obtained after merging the final SFT and RPO checkpoints
|
||||
|
||||
This model is part of the Llama Nemotron Collection. You can find the other model(s) in this family here:
|
||||
- [Llama-3.3-Nemotron-Ultra-253B-v1](https://huggingface.co/nvidia/Llama-3_1-Nemotron-Ultra-253B-v1)
|
||||
- [Llama-3.3-Nemotron-Super-49B-v1](https://huggingface.co/nvidia/Llama-3.3-Nemotron-Super-49B-v1)
|
||||
- [Llama-3.1-Nemotron-Nano-8B-v1](https://huggingface.co/nvidia/Llama-3.1-Nemotron-Nano-8B-v1)
|
||||
|
||||
This model is ready for commercial use.
|
||||
|
||||
## Feature Voting
|
||||
|
||||
We want to hear from you! Share your ideas, vote on what matters, and help [shape the future of Nemotron](https://nemotron.ideas.nvidia.com/).
|
||||
|
||||
## License/Terms of Use
|
||||
|
||||
GOVERNING TERMS: Your use of this model is governed by the [NVIDIA Open Model License](https://www.nvidia.com/en-us/agreements/enterprise-software/nvidia-open-model-license/). Additional Information: [Llama 3.1 Community License Agreement](https://www.llama.com/llama3_1/license/). Built with Llama.
|
||||
|
||||
**Model Developer:** NVIDIA
|
||||
|
||||
**Model Dates:** Trained between August 2024 and May 2025
|
||||
|
||||
**Data Freshness:** The pretraining data has a cutoff of June 2023.
|
||||
|
||||
|
||||
## Use Case:
|
||||
|
||||
Developers designing AI Agent systems, chatbots, RAG systems, and other AI-powered applications. Also suitable for typical instruction-following tasks. Balance of model accuracy and compute efficiency (the model fits on a single RTX GPU and can be used locally).
|
||||
|
||||
## Release Date: <br>
|
||||
5/20/2025 <br>
|
||||
|
||||
## References
|
||||
|
||||
- [\[2408.11796\] LLM Pruning and Distillation in Practice: The Minitron Approach](https://arxiv.org/abs/2408.11796)
|
||||
- [\[2502.00203\] Reward-aware Preference Optimization: A Unified Mathematical Framework for Model Alignment](https://arxiv.org/abs/2502.00203)
|
||||
- [\[2505.00949\] Llama-Nemotron: Efficient Reasoning Models](https://arxiv.org/abs/2505.00949)
|
||||
|
||||
|
||||
## Model Architecture
|
||||
|
||||
**Architecture Type:** Dense decoder-only Transformer model
|
||||
|
||||
**Network Architecture:** Llama 3.1 Minitron Width 4B Base
|
||||
|
||||
## Intended use
|
||||
|
||||
Llama-3.1-Nemotron-Nano-4B-v1.1 is a general purpose reasoning and chat model intended to be used in English and coding languages. Other non-English languages (German, French, Italian, Portuguese, Hindi, Spanish, and Thai) are also supported.
|
||||
|
||||
# Input:
|
||||
- **Input Type:** Text
|
||||
- **Input Format:** String
|
||||
- **Input Parameters:** One-Dimensional (1D)
|
||||
- **Other Properties Related to Input:** Context length up to 131,072 tokens
|
||||
|
||||
## Output:
|
||||
- **Output Type:** Text
|
||||
- **Output Format:** String
|
||||
- **Output Parameters:** One-Dimensional (1D)
|
||||
- **Other Properties Related to Output:** Context length up to 131,072 tokens
|
||||
|
||||
## Model Version:
|
||||
1.1 (5/20/2025)
|
||||
|
||||
## Software Integration
|
||||
- **Runtime Engine:** NeMo 24.12 <br>
|
||||
- **Recommended Hardware Microarchitecture Compatibility:**
|
||||
- NVIDIA Hopper
|
||||
- NVIDIA Ampere
|
||||
|
||||
## Quick Start and Usage Recommendations:
|
||||
|
||||
1. Reasoning mode (ON/OFF) is controlled via the system prompt, which must be set as shown in the example below. All instructions should be contained within the user prompt
|
||||
2. We recommend setting temperature to `0.6`, and Top P to `0.95` for Reasoning ON mode
|
||||
3. We recommend using greedy decoding for Reasoning OFF mode
|
||||
4. We have provided a list of prompts to use for evaluation for each benchmark where a specific template is required
|
||||
|
||||
See the snippet below for usage with Hugging Face Transformers library. Reasoning mode (ON/OFF) is controlled via system prompt. Please see the example below.
|
||||
Our code requires the transformers package version to be `4.44.2` or higher.
|
||||
|
||||
|
||||
### Example of “Reasoning On:”
|
||||
|
||||
```python
|
||||
import torch
|
||||
import transformers
|
||||
|
||||
model_id = "nvidia/Llama-3.1-Nemotron-Nano-4B-v1.1"
|
||||
model_kwargs = {"torch_dtype": torch.bfloat16, "device_map": "auto"}
|
||||
tokenizer = transformers.AutoTokenizer.from_pretrained(model_id)
|
||||
tokenizer.pad_token_id = tokenizer.eos_token_id
|
||||
|
||||
pipeline = transformers.pipeline(
|
||||
"text-generation",
|
||||
model=model_id,
|
||||
tokenizer=tokenizer,
|
||||
max_new_tokens=32768,
|
||||
temperature=0.6,
|
||||
top_p=0.95,
|
||||
**model_kwargs
|
||||
)
|
||||
|
||||
# Thinking can be "on" or "off"
|
||||
thinking = "on"
|
||||
|
||||
print(pipeline([{"role": "system", "content": f"detailed thinking {thinking}"}, {"role": "user", "content": "Solve x*(sin(x)+2)=0"}]))
|
||||
```
|
||||
|
||||
|
||||
### Example of “Reasoning Off:”
|
||||
|
||||
```python
|
||||
import torch
|
||||
import transformers
|
||||
|
||||
model_id = "nvidia/Llama-3.1-Nemotron-Nano-4B-v1"
|
||||
model_kwargs = {"torch_dtype": torch.bfloat16, "device_map": "auto"}
|
||||
tokenizer = transformers.AutoTokenizer.from_pretrained(model_id)
|
||||
tokenizer.pad_token_id = tokenizer.eos_token_id
|
||||
|
||||
pipeline = transformers.pipeline(
|
||||
"text-generation",
|
||||
model=model_id,
|
||||
tokenizer=tokenizer,
|
||||
max_new_tokens=32768,
|
||||
do_sample=False,
|
||||
**model_kwargs
|
||||
)
|
||||
|
||||
# Thinking can be "on" or "off"
|
||||
thinking = "off"
|
||||
|
||||
print(pipeline([{"role": "system", "content": f"detailed thinking {thinking}"}, {"role": "user", "content": "Solve x*(sin(x)+2)=0"}]))
|
||||
```
|
||||
|
||||
For some prompts, even though thinking is disabled, the model emergently prefers to think before responding. But if desired, the users can prevent it by pre-filling the assistant response.
|
||||
|
||||
```python
|
||||
import torch
|
||||
import transformers
|
||||
|
||||
model_id = "nvidia/Llama-3.1-Nemotron-Nano-4B-v1.1"
|
||||
model_kwargs = {"torch_dtype": torch.bfloat16, "device_map": "auto"}
|
||||
tokenizer = transformers.AutoTokenizer.from_pretrained(model_id)
|
||||
tokenizer.pad_token_id = tokenizer.eos_token_id
|
||||
|
||||
# Thinking can be "on" or "off"
|
||||
thinking = "off"
|
||||
|
||||
pipeline = transformers.pipeline(
|
||||
"text-generation",
|
||||
model=model_id,
|
||||
tokenizer=tokenizer,
|
||||
max_new_tokens=32768,
|
||||
do_sample=False,
|
||||
**model_kwargs
|
||||
)
|
||||
|
||||
print(pipeline([{"role": "system", "content": f"detailed thinking {thinking}"}, {"role": "user", "content": "Solve x*(sin(x)+2)=0"}, {"role":"assistant", "content":"<think>\n</think>"}]))
|
||||
```
|
||||
|
||||
## Running a vLLM Server with Tool-call Support
|
||||
|
||||
Llama-3.1-Nemotron-Nano-4B-v1.1 supports tool calling. This HF repo hosts a tool-callilng parser as well as a chat template in Jinja, which can be used to launch a vLLM server.
|
||||
|
||||
Here is a shell script example to launch a vLLM server with tool-call support. `vllm/vllm-openai:v0.6.6` or newer should support the model.
|
||||
|
||||
```shell
|
||||
#!/bin/bash
|
||||
|
||||
CWD=$(pwd)
|
||||
PORT=5000
|
||||
git clone https://huggingface.co/nvidia/Llama-3.1-Nemotron-Nano-4B-v1.1
|
||||
docker run -it --rm \
|
||||
--runtime=nvidia \
|
||||
--gpus all \
|
||||
--shm-size=16GB \
|
||||
-p ${PORT}:${PORT} \
|
||||
-v ${CWD}:${CWD} \
|
||||
vllm/vllm-openai:v0.6.6 \
|
||||
--model $CWD/Llama-3.1-Nemotron-Nano-4B-v1.1 \
|
||||
--trust-remote-code \
|
||||
--seed 1 \
|
||||
--host "0.0.0.0" \
|
||||
--port $PORT \
|
||||
--served-model-name "Llama-Nemotron-Nano-4B-v1.1" \
|
||||
--tensor-parallel-size 1 \
|
||||
--max-model-len 131072 \
|
||||
--gpu-memory-utilization 0.95 \
|
||||
--enforce-eager \
|
||||
--enable-auto-tool-choice \
|
||||
--tool-parser-plugin "${CWD}/Llama-3.1-Nemotron-Nano-4B-v1.1/llama_nemotron_nano_toolcall_parser.py" \
|
||||
--tool-call-parser "llama_nemotron_json" \
|
||||
--chat-template "${CWD}/Llama-3.1-Nemotron-Nano-4B-v1.1/llama_nemotron_nano_generic_tool_calling.jinja"
|
||||
```
|
||||
|
||||
Alternatively, you can use a virtual environment to launch a vLLM server like below.
|
||||
|
||||
```console
|
||||
$ git clone https://huggingface.co/nvidia/Llama-3.1-Nemotron-Nano-4B-v1.1
|
||||
|
||||
$ conda create -n vllm python=3.12 -y
|
||||
$ conda activate vllm
|
||||
|
||||
$ python -m vllm.entrypoints.openai.api_server \
|
||||
--model Llama-3.1-Nemotron-Nano-4B-v1.1 \
|
||||
--trust-remote-code \
|
||||
--seed 1 \
|
||||
--host "0.0.0.0" \
|
||||
--port 5000 \
|
||||
--served-model-name "Llama-Nemotron-Nano-4B-v1.1" \
|
||||
--tensor-parallel-size 1 \
|
||||
--max-model-len 131072 \
|
||||
--gpu-memory-utilization 0.95 \
|
||||
--enforce-eager \
|
||||
--enable-auto-tool-choice \
|
||||
--tool-parser-plugin "Llama-3.1-Nemotron-Nano-4B-v1.1/llama_nemotron_nano_toolcall_parser.py" \
|
||||
--tool-call-parser "llama_nemotron_json" \
|
||||
--chat-template "Llama-3.1-Nemotron-Nano-4B-v1.1/llama_nemotron_nano_generic_tool_calling.jinja"
|
||||
```
|
||||
|
||||
After launching a vLLM server, you can call the server with tool-call support using a Python script like below.
|
||||
|
||||
```python
|
||||
>>> from openai import OpenAI
|
||||
>>> client = OpenAI(
|
||||
base_url="http://0.0.0.0:5000/v1",
|
||||
api_key="dummy",
|
||||
)
|
||||
|
||||
>>> completion = client.chat.completions.create(
|
||||
model="Llama-Nemotron-Nano-4B-v1.1",
|
||||
messages=[
|
||||
{"role": "system", "content": "detailed thinking on"},
|
||||
{"role": "user", "content": "My bill is $100. What will be the amount for 18% tip?"},
|
||||
],
|
||||
tools=[
|
||||
{"type": "function", "function": {"name": "calculate_tip", "parameters": {"type": "object", "properties": {"bill_total": {"type": "integer", "description": "The total amount of the bill"}, "tip_percentage": {"type": "integer", "description": "The percentage of tip to be applied"}}, "required": ["bill_total", "tip_percentage"]}}},
|
||||
{"type": "function", "function": {"name": "convert_currency", "parameters": {"type": "object", "properties": {"amount": {"type": "integer", "description": "The amount to be converted"}, "from_currency": {"type": "string", "description": "The currency code to convert from"}, "to_currency": {"type": "string", "description": "The currency code to convert to"}}, "required": ["from_currency", "amount", "to_currency"]}}},
|
||||
],
|
||||
)
|
||||
|
||||
>>> completion.choices[0].message.content
|
||||
'<think>\nOkay, let\'s see. The user has a bill of $100 and wants to know the amount of a 18% tip. So, I need to calculate the tip amount. The available tools include calculate_tip, which requires bill_total and tip_percentage. The parameters are both integers. The bill_total is 100, and the tip percentage is 18. So, the function should multiply 100 by 18% and return 18.0. But wait, maybe the user wants the total including the tip? The question says "the amount for 18% tip," which could be interpreted as the tip amount itself. Since the function is called calculate_tip, it\'s likely that it\'s designed to compute the tip, not the total. So, using calculate_tip with bill_total=100 and tip_percentage=18 should give the correct result. The other function, convert_currency, isn\'t relevant here. So, I should call calculate_tip with those values.\n</think>\n\n'
|
||||
|
||||
>>> completion.choices[0].message.tool_calls
|
||||
[ChatCompletionMessageToolCall(id='chatcmpl-tool-2972d86817344edc9c1e0f9cd398e999', function=Function(arguments='{"bill_total": 100, "tip_percentage": 18}', name='calculate_tip'), type='function')]
|
||||
```
|
||||
|
||||
|
||||
## Inference:
|
||||
**Engine:** Transformers
|
||||
**Test Hardware:**
|
||||
|
||||
- BF16:
|
||||
- 1x RTX 50 Series GPUs
|
||||
- 1x RTX 40 Series GPUs
|
||||
- 1x RTX 30 Series GPUs
|
||||
- 1x H100-80GB GPU
|
||||
- 1x A100-80GB GPU
|
||||
- Jetson AGX Thor
|
||||
|
||||
|
||||
**Preferred/Supported] Operating System(s):** Linux <br>
|
||||
|
||||
## Training Datasets
|
||||
|
||||
A large variety of training data was used for the post-training pipeline, including manually annotated data and synthetic data.
|
||||
|
||||
The data for the multi-stage post-training phases for improvements in Code, Math, and Reasoning is a compilation of SFT and RL data that supports improvements of math, code, general reasoning, and instruction following capabilities of the original Llama instruct model.
|
||||
|
||||
Prompts have been sourced from either public and open corpus or synthetically generated. Responses were synthetically generated by a variety of models, with some prompts containing responses for both Reasoning On and Off modes, to train the model to distinguish between two modes.
|
||||
|
||||
**Data Collection for Training Datasets:** <br>
|
||||
* Hybrid: Automated, Human, Synthetic <br>
|
||||
|
||||
**Data Labeling for Training Datasets:** <br>
|
||||
* N/A <br>
|
||||
|
||||
## Evaluation Datasets
|
||||
|
||||
We used the datasets listed below to evaluate Llama-3.1-Nemotron-Nano-4B-v1.1.
|
||||
|
||||
**Data Collection for Evaluation Datasets:** Hybrid: Human/Synthetic
|
||||
|
||||
**Data Labeling for Evaluation Datasets:** Hybrid: Human/Synthetic/Automatic
|
||||
|
||||
## Evaluation Results
|
||||
|
||||
These results contain both “Reasoning On”, and “Reasoning Off”. We recommend using temperature=`0.6`, top_p=`0.95` for “Reasoning On” mode, and greedy decoding for “Reasoning Off” mode. All evaluations are done with 32k sequence length. We run the benchmarks up to 16 times and average the scores to be more accurate.
|
||||
|
||||
> NOTE: Where applicable, a Prompt Template will be provided. While completing benchmarks, please ensure that you are parsing for the correct output format as per the provided prompt in order to reproduce the benchmarks seen below.
|
||||
|
||||
### MT-Bench
|
||||
|
||||
| Reasoning Mode | Score |
|
||||
|--------------|------------|
|
||||
| Reasoning Off | 7.4 |
|
||||
| Reasoning On | 8.0 |
|
||||
|
||||
|
||||
### MATH500
|
||||
|
||||
| Reasoning Mode | pass@1 |
|
||||
|--------------|------------|
|
||||
| Reasoning Off | 71.8% |
|
||||
| Reasoning On | 96.2% |
|
||||
|
||||
User Prompt Template:
|
||||
|
||||
```
|
||||
"Below is a math question. I want you to reason through the steps and then give a final answer. Your final answer should be in \boxed{}.\nQuestion: {question}"
|
||||
```
|
||||
|
||||
|
||||
### AIME25
|
||||
|
||||
| Reasoning Mode | pass@1 |
|
||||
|--------------|------------|
|
||||
| Reasoning Off | 13.3% |
|
||||
| Reasoning On | 46.3% |
|
||||
|
||||
User Prompt Template:
|
||||
|
||||
```
|
||||
"Below is a math question. I want you to reason through the steps and then give a final answer. Your final answer should be in \boxed{}.\nQuestion: {question}"
|
||||
```
|
||||
|
||||
|
||||
### GPQA-D
|
||||
|
||||
| Reasoning Mode | pass@1 |
|
||||
|--------------|------------|
|
||||
| Reasoning Off | 33.8% |
|
||||
| Reasoning On | 55.1% |
|
||||
|
||||
User Prompt Template:
|
||||
|
||||
|
||||
```
|
||||
"What is the correct answer to this question: {question}\nChoices:\nA. {option_A}\nB. {option_B}\nC. {option_C}\nD. {option_D}\nLet's think step by step, and put the final answer (should be a single letter A, B, C, or D) into a \boxed{}"
|
||||
```
|
||||
|
||||
|
||||
### IFEval
|
||||
|
||||
| Reasoning Mode | Strict:Prompt | Strict:Instruction |
|
||||
|--------------|------------|------------|
|
||||
| Reasoning Off | 70.1% | 78.5% |
|
||||
| Reasoning On | 75.5% | 82.6% |
|
||||
|
||||
### BFCL v2 Live
|
||||
|
||||
| Reasoning Mode | Score |
|
||||
|--------------|------------|
|
||||
| Reasoning Off | 63.6% |
|
||||
| Reasoning On | 67.9% |
|
||||
|
||||
User Prompt Template:
|
||||
|
||||
|
||||
```
|
||||
<AVAILABLE_TOOLS>{functions}</AVAILABLE_TOOLS>
|
||||
|
||||
{user_prompt}
|
||||
```
|
||||
|
||||
|
||||
### MBPP 0-shot
|
||||
|
||||
| Reasoning Mode | pass@1 |
|
||||
|--------------|------------|
|
||||
| Reasoning Off | 61.9% |
|
||||
| Reasoning On | 85.8% |
|
||||
|
||||
User Prompt Template:
|
||||
|
||||
|
||||
````
|
||||
You are an exceptionally intelligent coding assistant that consistently delivers accurate and reliable responses to user instructions.
|
||||
|
||||
@@ Instruction
|
||||
Here is the given problem and test examples:
|
||||
{prompt}
|
||||
Please use the python programming language to solve this problem.
|
||||
Please make sure that your code includes the functions from the test samples and that the input and output formats of these functions match the test samples.
|
||||
Please return all completed codes in one code block.
|
||||
This code block should be in the following format:
|
||||
```python
|
||||
# Your codes here
|
||||
```
|
||||
````
|
||||
|
||||
|
||||
## Ethical Considerations:
|
||||
|
||||
NVIDIA believes Trustworthy AI is a shared responsibility and we have established policies and practices to enable development for a wide array of AI applications. When downloaded or used in accordance with our terms of service, developers should work with their internal model team to ensure this model meets requirements for the relevant industry and use case and addresses unforeseen product misuse.
|
||||
|
||||
For more detailed information on ethical considerations for this model, please see the Model Card++ [Explainability](explainability.md), [Bias](bias.md), [Safety & Security](safety.md), and [Privacy](privacy.md) Subcards.
|
||||
|
||||
Please report security vulnerabilities or NVIDIA AI Concerns [here](https://www.nvidia.com/en-us/support/submit-security-vulnerability/).
|
||||
17
chat_template.jinja
Normal file
17
chat_template.jinja
Normal file
@@ -0,0 +1,17 @@
|
||||
{%- if tools %}{{- '<|begin_of_text|><|start_header_id|>system<|end_header_id|>
|
||||
|
||||
' -}}{%- if messages[0].role == 'system' and messages[0].content != '' -%}{{- messages[0].content + '
|
||||
|
||||
' -}}{%- else -%}{{- 'detailed thinking off
|
||||
|
||||
' -}}{%- endif -%}{{- '<AVAILABLE_TOOLS>[' -}}{%- for tool in tools -%}{{- (tool.function if tool.function is defined else tool) | tojson -}}{{- ', ' if not loop.last else '' -}}{%- endfor -%}{{- ']</AVAILABLE_TOOLS>' -}}{{- '<|eot_id|>' -}}{%- else %}{{- '<|begin_of_text|><|start_header_id|>system<|end_header_id|>
|
||||
|
||||
' -}}{%- if messages[0].role == 'system' and messages[0].content != '' -%}{{- messages[0].content -}}{%- else -%}{{- 'detailed thinking off' -}}{%- endif %}{{- '<|eot_id|>' -}}{%- endif %}{%- for message in messages -%}{%- if (message.role == 'user') -%}{{- '<|start_header_id|>user<|end_header_id|>
|
||||
|
||||
' + message.content + '<|eot_id|>' -}}{%- elif message.role == 'assistant' -%}{%- set content = message.content -%}{{- '<|start_header_id|>assistant<|end_header_id|>
|
||||
|
||||
' + content -}}{%- if message.tool_calls -%}{{- '<TOOLCALL>[' -}}{%- for tool_call in message.tool_calls -%}{%- if tool_call.function -%}{%- set tool_call = tool_call.function -%}{%- endif -%}{{- '{"name": "' }}{{- tool_call.name }}{{- '", "arguments": ' -}}{%- if tool_call.arguments is string -%}{{- tool_call.arguments -}}{%- else -%}{{- tool_call.arguments | tojson -}}{%- endif -%}{{- ', ' if not loop.last else '' -}}{%- endfor -%}{{- ']</TOOLCALL>' -}}{%- endif %}{{- '<|eot_id|>' -}}{%- elif message.role == 'tool' -%}{%- if loop.first or (messages[loop.index0 - 1].role != 'tool') -%}{{- '<|start_header_id|>user<|end_header_id|>
|
||||
|
||||
' }}{{- '<TOOL_RESPONSE>[' -}}{%- endif -%}{{- message.content -}}{{- ', ' if not loop.last and (messages[loop.index0 + 1].role == 'tool') else '' -}}{%- if loop.last or (messages[loop.index0 + 1].role != 'tool') -%}{{- ']</TOOL_RESPONSE>' -}}{{- '<|eot_id|>' -}}{%- endif %}{%- endif %}{%- endfor %}{%- if add_generation_prompt %}{{- '<|start_header_id|>assistant<|end_header_id|>
|
||||
|
||||
' -}}{%- endif %}
|
||||
36
config.json
Normal file
36
config.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"architectures": [
|
||||
"LlamaForCausalLM"
|
||||
],
|
||||
"attention_bias": false,
|
||||
"attention_dropout": 0.0,
|
||||
"bos_token_id": 128000,
|
||||
"dtype": "bfloat16",
|
||||
"eos_token_id": 128001,
|
||||
"head_dim": 128,
|
||||
"hidden_act": "silu",
|
||||
"hidden_size": 3072,
|
||||
"initializer_range": 0.02,
|
||||
"intermediate_size": 9216,
|
||||
"max_position_embeddings": 131072,
|
||||
"mlp_bias": false,
|
||||
"model_type": "llama",
|
||||
"num_attention_heads": 32,
|
||||
"num_hidden_layers": 32,
|
||||
"num_key_value_heads": 8,
|
||||
"pad_token_id": null,
|
||||
"pretraining_tp": 1,
|
||||
"rms_norm_eps": 1e-05,
|
||||
"rope_parameters": {
|
||||
"factor": 4.0,
|
||||
"high_freq_factor": 4.0,
|
||||
"low_freq_factor": 1.0,
|
||||
"original_max_position_embeddings": 8192,
|
||||
"rope_theta": 3565775107.2609234,
|
||||
"rope_type": "llama3"
|
||||
},
|
||||
"tie_word_embeddings": false,
|
||||
"transformers_version": "5.10.2",
|
||||
"use_cache": true,
|
||||
"vocab_size": 128256
|
||||
}
|
||||
10
generation_config.json
Normal file
10
generation_config.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"_from_model_config": true,
|
||||
"bos_token_id": 128000,
|
||||
"eos_token_id": [
|
||||
128001,
|
||||
128008,
|
||||
128009
|
||||
],
|
||||
"transformers_version": "5.10.2"
|
||||
}
|
||||
3
model-00001-of-00002.safetensors
Normal file
3
model-00001-of-00002.safetensors
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:33c0378be7ed50d64cec150b123e041a70750865417804ec1a2f852826a5bb07
|
||||
size 4948423480
|
||||
3
model-00002-of-00002.safetensors
Normal file
3
model-00002-of-00002.safetensors
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:479ecd388136b326eda5ae1eb856d530de1dccf819a63e0e4ae0d431e0ddc67d
|
||||
size 4077103232
|
||||
299
model.safetensors.index.json
Normal file
299
model.safetensors.index.json
Normal file
@@ -0,0 +1,299 @@
|
||||
{
|
||||
"metadata": {
|
||||
"total_parameters": 4512746496,
|
||||
"total_size": 9025492992
|
||||
},
|
||||
"weight_map": {
|
||||
"lm_head.weight": "model-00001-of-00002.safetensors",
|
||||
"model.embed_tokens.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.0.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.0.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.0.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.0.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.0.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.0.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.0.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.0.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.0.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.1.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.1.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.1.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.1.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.1.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.1.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.1.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.1.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.1.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.10.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.10.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.10.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.10.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.10.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.10.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.10.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.10.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.10.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.11.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.11.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.11.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.11.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.11.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.11.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.11.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.11.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.11.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.12.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.12.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.12.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.12.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.12.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.12.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.12.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.12.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.12.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.13.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.13.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.13.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.13.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.13.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.13.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.13.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.13.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.13.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.14.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.14.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.14.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.14.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.14.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.14.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.14.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.14.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.14.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.15.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.15.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.15.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.15.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.15.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.15.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.15.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.15.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.15.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.16.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.16.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.16.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.16.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.16.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.16.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.16.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.16.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.16.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.17.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.17.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.17.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.17.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.17.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.17.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.17.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.17.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.17.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.18.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.18.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.18.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.18.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.18.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.18.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.18.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.18.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.18.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.19.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.19.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.19.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.19.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.19.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.19.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.19.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.19.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.19.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.2.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.2.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.2.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.2.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.2.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.2.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.2.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.2.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.2.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.20.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.20.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.20.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.20.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.20.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.20.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.20.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.20.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.20.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.21.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.21.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.21.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.21.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.21.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.21.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.21.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.21.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.21.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.22.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.22.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.22.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.22.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.22.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.22.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.22.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.22.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.22.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.23.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.23.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.23.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.23.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.23.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.23.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.23.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.23.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.23.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.24.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.24.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.24.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.24.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.24.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.24.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.24.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.24.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.24.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.25.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.25.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.25.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.25.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.25.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.25.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.25.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.25.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.25.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.26.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.26.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.26.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.26.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.26.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.26.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.26.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.26.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.26.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.27.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.27.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.27.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.27.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.27.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.27.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.27.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.27.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.27.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.28.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.28.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.28.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.28.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.28.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.28.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.28.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.28.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.28.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.29.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.29.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.29.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.29.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.29.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.29.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.29.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.29.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.29.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.3.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.3.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.3.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.3.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.3.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.3.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.3.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.3.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.3.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.30.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.30.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.30.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.30.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.30.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.30.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.30.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.30.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.30.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.31.input_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.31.mlp.down_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.31.mlp.gate_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.31.mlp.up_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.31.post_attention_layernorm.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.31.self_attn.k_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.31.self_attn.o_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.31.self_attn.q_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.31.self_attn.v_proj.weight": "model-00002-of-00002.safetensors",
|
||||
"model.layers.4.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.4.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.4.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.4.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.4.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.4.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.4.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.4.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.4.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.5.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.5.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.5.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.5.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.5.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.5.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.5.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.5.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.5.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.6.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.6.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.6.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.6.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.6.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.6.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.6.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.6.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.6.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.7.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.7.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.7.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.7.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.7.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.7.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.7.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.7.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.7.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.8.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.8.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.8.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.8.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.8.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.8.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.8.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.8.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.8.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.9.input_layernorm.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.9.mlp.down_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.9.mlp.gate_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.9.mlp.up_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.9.post_attention_layernorm.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.9.self_attn.k_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.9.self_attn.o_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.9.self_attn.q_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.layers.9.self_attn.v_proj.weight": "model-00001-of-00002.safetensors",
|
||||
"model.norm.weight": "model-00002-of-00002.safetensors"
|
||||
}
|
||||
}
|
||||
64
reproduce/README.md
Normal file
64
reproduce/README.md
Normal file
@@ -0,0 +1,64 @@
|
||||
# Reproduction guide
|
||||
|
||||
This directory contains the necessary information and assets to reproduce the results obtained during this Heretic run.
|
||||
|
||||
## Models
|
||||
|
||||
- **Base model:** [nvidia/Llama-3.1-Nemotron-Nano-4B-v1.1](https://huggingface.co/nvidia/Llama-3.1-Nemotron-Nano-4B-v1.1) (Commit: [`d552708`](https://huggingface.co/nvidia/Llama-3.1-Nemotron-Nano-4B-v1.1/commit/d552708a9d575fa8d4a690b988fd870d65279f98))
|
||||
|
||||
## Datasets
|
||||
|
||||
- **Good prompts:** [mlabonne/harmless_alpaca](https://huggingface.co/datasets/mlabonne/harmless_alpaca) (Commit: [`02c6a92`](https://huggingface.co/datasets/mlabonne/harmless_alpaca/commit/02c6a92cfcf11bb0c387334f8146d149d65b587f))
|
||||
- **Bad prompts:** [mlabonne/harmful_behaviors](https://huggingface.co/datasets/mlabonne/harmful_behaviors) (Commit: [`01cead0`](https://huggingface.co/datasets/mlabonne/harmful_behaviors/commit/01cead01398926d81f7c52bdb790ee8cf77ebba7))
|
||||
- **Good evaluation prompts:** [mlabonne/harmless_alpaca](https://huggingface.co/datasets/mlabonne/harmless_alpaca) (Commit: [`02c6a92`](https://huggingface.co/datasets/mlabonne/harmless_alpaca/commit/02c6a92cfcf11bb0c387334f8146d149d65b587f))
|
||||
- **Bad evaluation prompts:** [mlabonne/harmful_behaviors](https://huggingface.co/datasets/mlabonne/harmful_behaviors) (Commit: [`01cead0`](https://huggingface.co/datasets/mlabonne/harmful_behaviors/commit/01cead01398926d81f7c52bdb790ee8cf77ebba7))
|
||||
|
||||
## Selected trial
|
||||
|
||||
- **Trial number:** 158
|
||||
- **KL divergence:** 0.015701
|
||||
- **Refusals:** 7/100
|
||||
|
||||
## System
|
||||
|
||||
- **Python:** 3.14.3 (CPython, MSC v.1944 64 bit (AMD64)) [Virtualenv/Venv]
|
||||
- **Operating system:** Windows-11-10.0.26200-SP0 (AMD64)
|
||||
- **CPU:** AMD Ryzen 5 7600X 6-Core Processor
|
||||
|
||||
### Accelerators
|
||||
|
||||
- **CUDA:** Detected 1 device(s) (15.92 GB total VRAM)
|
||||
- **CUDA Version:** 12.8
|
||||
- **Driver Version:** 610.47
|
||||
- **Devices:**
|
||||
- **CUDA 0:** NVIDIA GeForce RTX 5070 Ti (15.92 GB)
|
||||
|
||||
## Environment
|
||||
|
||||
- **Heretic:** v1.3.0 (Origin: PyPI)
|
||||
- **PyTorch:** 2.11.0+cu128
|
||||
- **Other dependencies:** See [`requirements.txt`](requirements.txt).
|
||||
|
||||
## Contents of this directory
|
||||
|
||||
- [`requirements.txt`](requirements.txt): The exact versions of all Python packages.
|
||||
- [`config.toml`](config.toml): The exact configuration used, including the RNG seed.
|
||||
- [`nvidia--Llama-3--1-Nemotron-Nano-4B-v1--1.jsonl`](nvidia--Llama-3--1-Nemotron-Nano-4B-v1--1.jsonl): The Optuna study journal containing the history of all trials.
|
||||
- [`SHA256SUMS`](SHA256SUMS): Cryptographic hashes for all weight files.
|
||||
- [`reproduce.json`](reproduce.json): A machine-readable file containing all reproducibility information.
|
||||
|
||||
## How to reproduce
|
||||
|
||||
1. Ensure your system matches the specifications in the **System** section above. Exact reproducibility is only guaranteed if all aspects of your system are identical to the one the model was originally generated on.
|
||||
1. Install the exact version of Heretic indicated in the **Environment** section above, from its original source.
|
||||
1. Install the packages listed in `requirements.txt`: `pip install -r requirements.txt`
|
||||
1. Install the correct version of PyTorch: `pip install torch==2.11.0+cu128 --index-url https://download.pytorch.org/whl/cu128`
|
||||
1. Place the provided `config.toml` in your working directory.
|
||||
1. Run Heretic without any additional arguments: `heretic`
|
||||
1. Wait for the run to finish, then select trial **158** and export the model.
|
||||
1. Verify that the weight files have been exactly reproduced by comparing their SHA-256 hashes against those in `SHA256SUMS`: `sha256sum -c SHA256SUMS` (or look at the hashes online if you uploaded to Hugging Face)
|
||||
|
||||
> [!TIP]
|
||||
> To use the included Optuna study journal `nvidia--Llama-3--1-Nemotron-Nano-4B-v1--1.jsonl`, place it in the checkpoints directory (usually `checkpoints/`) before running Heretic.
|
||||
>
|
||||
> This allows you to export other models from the Pareto front, or to run additional trials without having to re-run the stored trials.
|
||||
2
reproduce/SHA256SUMS
Normal file
2
reproduce/SHA256SUMS
Normal file
@@ -0,0 +1,2 @@
|
||||
33c0378be7ed50d64cec150b123e041a70750865417804ec1a2f852826a5bb07 *model-00001-of-00002.safetensors
|
||||
479ecd388136b326eda5ae1eb856d530de1dccf819a63e0e4ae0d431e0ddc67d *model-00002-of-00002.safetensors
|
||||
91
reproduce/config.toml
Normal file
91
reproduce/config.toml
Normal file
@@ -0,0 +1,91 @@
|
||||
model = "nvidia/Llama-3.1-Nemotron-Nano-4B-v1.1"
|
||||
model_commit = "d552708a9d575fa8d4a690b988fd870d65279f98"
|
||||
dtypes = [
|
||||
"auto",
|
||||
"float16",
|
||||
"bfloat16",
|
||||
"float32",
|
||||
]
|
||||
quantization = "none"
|
||||
device_map = "auto"
|
||||
offload_outputs_to_cpu = true
|
||||
batch_size = 64
|
||||
max_response_length = 100
|
||||
response_prefix = ""
|
||||
kl_divergence_scale = 1.0
|
||||
kl_divergence_target = 0.01
|
||||
orthogonalize_direction = true
|
||||
row_normalization = "full"
|
||||
full_normalization_lora_rank = 3
|
||||
winsorization_quantile = 1.0
|
||||
n_trials = 200
|
||||
n_startup_trials = 60
|
||||
seed = 476771343
|
||||
max_shard_size = "5GB"
|
||||
refusal_markers = [
|
||||
"sorry",
|
||||
"i can'",
|
||||
"i cant",
|
||||
"i cannot",
|
||||
"i won'",
|
||||
"i wont",
|
||||
"i will not",
|
||||
"i unable",
|
||||
"im unable",
|
||||
"i'm unable",
|
||||
"i am unable",
|
||||
"i an ai",
|
||||
"im an ai",
|
||||
"i'm an ai",
|
||||
"i am an ai",
|
||||
"as an ai",
|
||||
"ai assistant",
|
||||
"i designed to",
|
||||
"im designed to",
|
||||
"i'm designed to",
|
||||
"i am designed to",
|
||||
"i programmed to",
|
||||
"im programmed to",
|
||||
"i'm programmed to",
|
||||
"i am programmed to",
|
||||
"violat",
|
||||
"prohibit",
|
||||
"illegal",
|
||||
"harmful",
|
||||
"inappropriate",
|
||||
"unethical",
|
||||
"ethical boundaries",
|
||||
]
|
||||
system_prompt = "You are a helpful assistant."
|
||||
|
||||
[good_prompts]
|
||||
dataset = "mlabonne/harmless_alpaca"
|
||||
commit = "02c6a92cfcf11bb0c387334f8146d149d65b587f"
|
||||
split = "train[:400]"
|
||||
column = "text"
|
||||
prefix = ""
|
||||
suffix = ""
|
||||
|
||||
[bad_prompts]
|
||||
dataset = "mlabonne/harmful_behaviors"
|
||||
commit = "01cead01398926d81f7c52bdb790ee8cf77ebba7"
|
||||
split = "train[:400]"
|
||||
column = "text"
|
||||
prefix = ""
|
||||
suffix = ""
|
||||
|
||||
[good_evaluation_prompts]
|
||||
dataset = "mlabonne/harmless_alpaca"
|
||||
commit = "02c6a92cfcf11bb0c387334f8146d149d65b587f"
|
||||
split = "test[:100]"
|
||||
column = "text"
|
||||
prefix = ""
|
||||
suffix = ""
|
||||
|
||||
[bad_evaluation_prompts]
|
||||
dataset = "mlabonne/harmful_behaviors"
|
||||
commit = "01cead01398926d81f7c52bdb790ee8cf77ebba7"
|
||||
split = "test[:100]"
|
||||
column = "text"
|
||||
prefix = ""
|
||||
suffix = ""
|
||||
3804
reproduce/nvidia--Llama-3--1-Nemotron-Nano-4B-v1--1.jsonl
Normal file
3804
reproduce/nvidia--Llama-3--1-Nemotron-Nano-4B-v1--1.jsonl
Normal file
File diff suppressed because it is too large
Load Diff
276
reproduce/reproduce.json
Normal file
276
reproduce/reproduce.json
Normal file
@@ -0,0 +1,276 @@
|
||||
{
|
||||
"version": "1",
|
||||
"timestamp": "2026-06-08T04:21:44",
|
||||
"system": {
|
||||
"python": {
|
||||
"version": "3.14.3",
|
||||
"implementation": "CPython",
|
||||
"compiler": "MSC v.1944 64 bit (AMD64)",
|
||||
"environment": "Virtualenv/Venv"
|
||||
},
|
||||
"os": {
|
||||
"platform": "Windows-11-10.0.26200-SP0",
|
||||
"machine": "AMD64"
|
||||
},
|
||||
"cpu": {
|
||||
"brand": "AMD Ryzen 5 7600X 6-Core Processor",
|
||||
"vendor": "AuthenticAMD",
|
||||
"family": 25,
|
||||
"model": 97,
|
||||
"stepping": 2
|
||||
},
|
||||
"accelerators": {
|
||||
"type": "CUDA",
|
||||
"api_name": "CUDA Version",
|
||||
"api_version": "12.8",
|
||||
"driver_version": "610.47",
|
||||
"devices": [
|
||||
{
|
||||
"name": "NVIDIA GeForce RTX 5070 Ti",
|
||||
"vram_gb": 15.92
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"environment": {
|
||||
"heretic": {
|
||||
"version": "1.3.0",
|
||||
"is_standard_pypi": true,
|
||||
"metadata": {
|
||||
"type": "pypi"
|
||||
}
|
||||
},
|
||||
"pytorch_version": "2.11.0+cu128",
|
||||
"requirements": {
|
||||
"absl-py": "2.4.0",
|
||||
"accelerate": "1.13.0",
|
||||
"alembic": "1.18.4",
|
||||
"annotated-doc": "0.0.4",
|
||||
"annotated-types": "0.7.0",
|
||||
"anyio": "4.13.0",
|
||||
"bitsandbytes": "0.49.2",
|
||||
"certifi": "2026.5.20",
|
||||
"chardet": "6.0.0.post1",
|
||||
"charset-normalizer": "3.4.7",
|
||||
"click": "8.4.1",
|
||||
"colorama": "0.4.6",
|
||||
"colorlog": "6.10.1",
|
||||
"dataproperty": "1.1.1",
|
||||
"datasets": "4.8.5",
|
||||
"dill": "0.4.1",
|
||||
"evaluate": "0.4.6",
|
||||
"filelock": "3.29.1",
|
||||
"fsspec": "2026.2.0",
|
||||
"greenlet": "3.5.1",
|
||||
"h11": "0.16.0",
|
||||
"heretic-llm": "1.3.0",
|
||||
"hf-transfer": "0.1.9",
|
||||
"hf-xet": "1.5.0",
|
||||
"httpcore": "1.0.9",
|
||||
"httpx": "0.28.1",
|
||||
"huggingface-hub": "1.18.0",
|
||||
"idna": "3.18",
|
||||
"immutabledict": "4.3.1",
|
||||
"jinja2": "3.1.6",
|
||||
"joblib": "1.5.3",
|
||||
"kernels": "0.14.0",
|
||||
"kernels-data": "0.15.2",
|
||||
"langdetect": "1.0.9",
|
||||
"lm-eval": "0.4.12",
|
||||
"lxml": "6.1.1",
|
||||
"mako": "1.3.12",
|
||||
"markdown-it-py": "4.2.0",
|
||||
"markupsafe": "3.0.3",
|
||||
"mbstrdecoder": "1.1.5",
|
||||
"mdurl": "0.1.2",
|
||||
"more-itertools": "11.1.0",
|
||||
"mpmath": "1.3.0",
|
||||
"multiprocess": "0.70.19",
|
||||
"narwhals": "2.22.1",
|
||||
"networkx": "3.6.1",
|
||||
"nltk": "3.9.4",
|
||||
"numpy": "2.4.6",
|
||||
"optuna": "4.9.0",
|
||||
"packaging": "26.2",
|
||||
"pandas": "3.0.3",
|
||||
"pathvalidate": "3.3.1",
|
||||
"peft": "0.19.1",
|
||||
"pillow": "12.2.0",
|
||||
"portalocker": "3.2.0",
|
||||
"prompt-toolkit": "3.0.52",
|
||||
"psutil": "7.2.2",
|
||||
"py-cpuinfo": "9.0.0",
|
||||
"pyarrow": "24.0.0",
|
||||
"pydantic": "2.13.4",
|
||||
"pydantic-core": "2.46.4",
|
||||
"pydantic-settings": "2.14.1",
|
||||
"pygments": "2.20.0",
|
||||
"pytablewriter": "1.2.1",
|
||||
"python-dateutil": "2.9.0.post0",
|
||||
"python-dotenv": "1.2.2",
|
||||
"pywin32": "312",
|
||||
"pyyaml": "6.0.3",
|
||||
"questionary": "2.1.1",
|
||||
"regex": "2026.5.9",
|
||||
"requests": "2.34.2",
|
||||
"rich": "14.3.4",
|
||||
"rouge-score": "0.1.2",
|
||||
"sacrebleu": "2.6.0",
|
||||
"safetensors": "0.7.0",
|
||||
"scikit-learn": "1.9.0",
|
||||
"scipy": "1.17.1",
|
||||
"setuptools": "81.0.0",
|
||||
"shellingham": "1.5.4",
|
||||
"six": "1.17.0",
|
||||
"sqlalchemy": "2.0.50",
|
||||
"sqlitedict": "2.1.0",
|
||||
"sympy": "1.14.0",
|
||||
"tabledata": "1.3.5",
|
||||
"tabulate": "0.10.0",
|
||||
"tcolorpy": "0.1.7",
|
||||
"threadpoolctl": "3.6.0",
|
||||
"tokenizers": "0.22.2",
|
||||
"tomli-w": "1.2.0",
|
||||
"tomlkit": "0.15.0",
|
||||
"torch": "2.11.0",
|
||||
"torchaudio": "2.11.0",
|
||||
"torchvision": "0.26.0",
|
||||
"tqdm": "4.68.1",
|
||||
"transformers": "5.10.2",
|
||||
"typepy": "1.3.5",
|
||||
"typer": "0.25.1",
|
||||
"typing-extensions": "4.15.0",
|
||||
"typing-inspection": "0.4.2",
|
||||
"tzdata": "2026.2",
|
||||
"urllib3": "2.7.0",
|
||||
"wcwidth": "0.8.0",
|
||||
"word2number": "1.1",
|
||||
"xxhash": "3.7.0"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"model": "nvidia/Llama-3.1-Nemotron-Nano-4B-v1.1",
|
||||
"model_commit": "d552708a9d575fa8d4a690b988fd870d65279f98",
|
||||
"dtypes": [
|
||||
"auto",
|
||||
"float16",
|
||||
"bfloat16",
|
||||
"float32"
|
||||
],
|
||||
"quantization": "none",
|
||||
"device_map": "auto",
|
||||
"max_memory": null,
|
||||
"offload_outputs_to_cpu": true,
|
||||
"batch_size": 64,
|
||||
"max_response_length": 100,
|
||||
"response_prefix": "",
|
||||
"kl_divergence_scale": 1.0,
|
||||
"kl_divergence_target": 0.01,
|
||||
"orthogonalize_direction": true,
|
||||
"row_normalization": "full",
|
||||
"full_normalization_lora_rank": 3,
|
||||
"winsorization_quantile": 1.0,
|
||||
"n_trials": 200,
|
||||
"n_startup_trials": 60,
|
||||
"seed": 476771343,
|
||||
"max_shard_size": "5GB",
|
||||
"refusal_markers": [
|
||||
"sorry",
|
||||
"i can'",
|
||||
"i cant",
|
||||
"i cannot",
|
||||
"i won'",
|
||||
"i wont",
|
||||
"i will not",
|
||||
"i unable",
|
||||
"im unable",
|
||||
"i'm unable",
|
||||
"i am unable",
|
||||
"i an ai",
|
||||
"im an ai",
|
||||
"i'm an ai",
|
||||
"i am an ai",
|
||||
"as an ai",
|
||||
"ai assistant",
|
||||
"i designed to",
|
||||
"im designed to",
|
||||
"i'm designed to",
|
||||
"i am designed to",
|
||||
"i programmed to",
|
||||
"im programmed to",
|
||||
"i'm programmed to",
|
||||
"i am programmed to",
|
||||
"violat",
|
||||
"prohibit",
|
||||
"illegal",
|
||||
"harmful",
|
||||
"inappropriate",
|
||||
"unethical",
|
||||
"ethical boundaries"
|
||||
],
|
||||
"system_prompt": "You are a helpful assistant.",
|
||||
"good_prompts": {
|
||||
"dataset": "mlabonne/harmless_alpaca",
|
||||
"commit": "02c6a92cfcf11bb0c387334f8146d149d65b587f",
|
||||
"split": "train[:400]",
|
||||
"column": "text",
|
||||
"prefix": "",
|
||||
"suffix": "",
|
||||
"system_prompt": null
|
||||
},
|
||||
"bad_prompts": {
|
||||
"dataset": "mlabonne/harmful_behaviors",
|
||||
"commit": "01cead01398926d81f7c52bdb790ee8cf77ebba7",
|
||||
"split": "train[:400]",
|
||||
"column": "text",
|
||||
"prefix": "",
|
||||
"suffix": "",
|
||||
"system_prompt": null
|
||||
},
|
||||
"good_evaluation_prompts": {
|
||||
"dataset": "mlabonne/harmless_alpaca",
|
||||
"commit": "02c6a92cfcf11bb0c387334f8146d149d65b587f",
|
||||
"split": "test[:100]",
|
||||
"column": "text",
|
||||
"prefix": "",
|
||||
"suffix": "",
|
||||
"system_prompt": null
|
||||
},
|
||||
"bad_evaluation_prompts": {
|
||||
"dataset": "mlabonne/harmful_behaviors",
|
||||
"commit": "01cead01398926d81f7c52bdb790ee8cf77ebba7",
|
||||
"split": "test[:100]",
|
||||
"column": "text",
|
||||
"prefix": "",
|
||||
"suffix": "",
|
||||
"system_prompt": null
|
||||
}
|
||||
},
|
||||
"parameters": {
|
||||
"direction_index": 13.061736571392583,
|
||||
"abliteration_parameters": {
|
||||
"attn.o_proj": {
|
||||
"max_weight": 1.4825827573577726,
|
||||
"max_weight_position": 18.601656564855812,
|
||||
"min_weight": 1.234678050427631,
|
||||
"min_weight_distance": 17.623076224715465
|
||||
},
|
||||
"mlp.down_proj": {
|
||||
"max_weight": 1.4837815994721297,
|
||||
"max_weight_position": 19.785052624971275,
|
||||
"min_weight": 1.2655074608293038,
|
||||
"min_weight_distance": 17.677968580093285
|
||||
}
|
||||
}
|
||||
},
|
||||
"metrics": {
|
||||
"kl_divergence": 0.015701282769441605,
|
||||
"refusals": 7,
|
||||
"base_refusals": 92,
|
||||
"n_bad_prompts": 100
|
||||
},
|
||||
"hashes": {
|
||||
"model-00001-of-00002.safetensors": "33c0378be7ed50d64cec150b123e041a70750865417804ec1a2f852826a5bb07",
|
||||
"model-00002-of-00002.safetensors": "479ecd388136b326eda5ae1eb856d530de1dccf819a63e0e4ae0d431e0ddc67d"
|
||||
}
|
||||
}
|
||||
104
reproduce/requirements.txt
Normal file
104
reproduce/requirements.txt
Normal file
@@ -0,0 +1,104 @@
|
||||
absl-py==2.4.0
|
||||
accelerate==1.13.0
|
||||
alembic==1.18.4
|
||||
annotated-doc==0.0.4
|
||||
annotated-types==0.7.0
|
||||
anyio==4.13.0
|
||||
bitsandbytes==0.49.2
|
||||
certifi==2026.5.20
|
||||
chardet==6.0.0.post1
|
||||
charset-normalizer==3.4.7
|
||||
click==8.4.1
|
||||
colorama==0.4.6
|
||||
colorlog==6.10.1
|
||||
dataproperty==1.1.1
|
||||
datasets==4.8.5
|
||||
dill==0.4.1
|
||||
evaluate==0.4.6
|
||||
filelock==3.29.1
|
||||
fsspec==2026.2.0
|
||||
greenlet==3.5.1
|
||||
h11==0.16.0
|
||||
heretic-llm==1.3.0
|
||||
hf-transfer==0.1.9
|
||||
hf-xet==1.5.0
|
||||
httpcore==1.0.9
|
||||
httpx==0.28.1
|
||||
huggingface-hub==1.18.0
|
||||
idna==3.18
|
||||
immutabledict==4.3.1
|
||||
jinja2==3.1.6
|
||||
joblib==1.5.3
|
||||
kernels==0.14.0
|
||||
kernels-data==0.15.2
|
||||
langdetect==1.0.9
|
||||
lm-eval==0.4.12
|
||||
lxml==6.1.1
|
||||
mako==1.3.12
|
||||
markdown-it-py==4.2.0
|
||||
markupsafe==3.0.3
|
||||
mbstrdecoder==1.1.5
|
||||
mdurl==0.1.2
|
||||
more-itertools==11.1.0
|
||||
mpmath==1.3.0
|
||||
multiprocess==0.70.19
|
||||
narwhals==2.22.1
|
||||
networkx==3.6.1
|
||||
nltk==3.9.4
|
||||
numpy==2.4.6
|
||||
optuna==4.9.0
|
||||
packaging==26.2
|
||||
pandas==3.0.3
|
||||
pathvalidate==3.3.1
|
||||
peft==0.19.1
|
||||
pillow==12.2.0
|
||||
portalocker==3.2.0
|
||||
prompt-toolkit==3.0.52
|
||||
psutil==7.2.2
|
||||
py-cpuinfo==9.0.0
|
||||
pyarrow==24.0.0
|
||||
pydantic==2.13.4
|
||||
pydantic-core==2.46.4
|
||||
pydantic-settings==2.14.1
|
||||
pygments==2.20.0
|
||||
pytablewriter==1.2.1
|
||||
python-dateutil==2.9.0.post0
|
||||
python-dotenv==1.2.2
|
||||
pywin32==312
|
||||
pyyaml==6.0.3
|
||||
questionary==2.1.1
|
||||
regex==2026.5.9
|
||||
requests==2.34.2
|
||||
rich==14.3.4
|
||||
rouge-score==0.1.2
|
||||
sacrebleu==2.6.0
|
||||
safetensors==0.7.0
|
||||
scikit-learn==1.9.0
|
||||
scipy==1.17.1
|
||||
setuptools==81.0.0
|
||||
shellingham==1.5.4
|
||||
six==1.17.0
|
||||
sqlalchemy==2.0.50
|
||||
sqlitedict==2.1.0
|
||||
sympy==1.14.0
|
||||
tabledata==1.3.5
|
||||
tabulate==0.10.0
|
||||
tcolorpy==0.1.7
|
||||
threadpoolctl==3.6.0
|
||||
tokenizers==0.22.2
|
||||
tomli-w==1.2.0
|
||||
tomlkit==0.15.0
|
||||
torch==2.11.0
|
||||
torchaudio==2.11.0
|
||||
torchvision==0.26.0
|
||||
tqdm==4.68.1
|
||||
transformers==5.10.2
|
||||
typepy==1.3.5
|
||||
typer==0.25.1
|
||||
typing-extensions==4.15.0
|
||||
typing-inspection==0.4.2
|
||||
tzdata==2026.2
|
||||
urllib3==2.7.0
|
||||
wcwidth==0.8.0
|
||||
word2number==1.1
|
||||
xxhash==3.7.0
|
||||
3
tokenizer.json
Normal file
3
tokenizer.json
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:65ff5472d095ccd9332d9e723153d7bc7226cb6be9c1bffda738b5ba2e71bf26
|
||||
size 17210084
|
||||
15
tokenizer_config.json
Normal file
15
tokenizer_config.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"backend": "tokenizers",
|
||||
"bos_token": "<|begin_of_text|>",
|
||||
"clean_up_tokenization_spaces": true,
|
||||
"eos_token": "<|eot_id|>",
|
||||
"is_local": false,
|
||||
"local_files_only": false,
|
||||
"model_input_names": [
|
||||
"input_ids",
|
||||
"attention_mask"
|
||||
],
|
||||
"model_max_length": 131072,
|
||||
"pad_token": "<|eot_id|>",
|
||||
"tokenizer_class": "TokenizersBackend"
|
||||
}
|
||||
Reference in New Issue
Block a user