Downloads · 30 days
497
6% of all-time downloads
ericflo/Llama-3.1-8B-ContinuedTraining2-FFT
Llama-3.1-8B-ContinuedTraining2-FFT is a text generation model from ericflo. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
This project implements a custom-trained language model based on the Meta-Llama-3.1-8B architecture. Unlike the previous version which used a high-rank adapter, this model employs full fine-tuning for enhanced learnin…
Downloads · 30 days
497
6% of all-time downloads
All-time downloads
8.4K
Public
Parameters
8B
455 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors193 GB · 42%
From the Hugging Face model README
This project implements a custom-trained language model based on the Meta-Llama-3.1-8B architecture. Unlike the previous version which used a high-rank adapter, this model employs full fine-tuning for enhanced learning capacity across a variety of tasks.
This model is trained directly on a mixture of high-quality datasets for general text and code completion tasks, as well as instruction-following. Key features include:
The model is trained on a blend of high-quality data sources:
pip install -U transformers accelerate trl wandb wheel packaging peft bitsandbytes liger-kernel flash_attn
adamw_bnb_8bit for memory-efficient training.flash_attention_2 for faster training.use_liger=true and packing=true for efficient data handling.bfloat16 for balanced precision and performance.This model incorporates several advanced training techniques to enhance its capabilities:
FIM allows the model to complete text when given both a prefix and a suffix, making it particularly useful for tasks like code completion, text infilling, and context-aware generation.
To use the FIM capability, structure your input with special tokens:
<|fim_start|>: Marks the start of the FIM input<|fim_marker|>: Separates the prefix from the suffix<|fim_gen|>: Indicates where the generated content should begin<|fim_end|>: Marks the end of the FIM inputExample FIM input:
<|fim_start|>{prefix}<|fim_marker|>{suffix}<|fim_gen|>
The model will generate content to replace <|fim_gen|>, filling in the middle between the prefix and suffix.
This technique enhances the model's context understanding by training it to predict previous parts of a conversation or text. It's also known as instruction backtranslation.
Input:
Human: Thank you for the information about Paris. Can you recommend some popular tourist attractions there?
Task: Predict the previous exchange in this conversation.
Possible model output:
Human: What's the capital of France?
Assistant: The capital of France is Paris. It's known as the "City of Light" and is famous for its art, culture, and historic landmarks.
Human: Thank you for the information about Paris. Can you recommend some popular tourist attractions there?
Meta-FIM applies the Fill-in-the-Middle technique to larger chunks of text, including entire conversations or documents. This improves the model's ability to handle complex, nested contexts.
<|fim_start|>Human: What's the weather like today?
Assistant: I'm sorry, but I don't have access to real-time weather information. Could you please provide your location?<|fim_marker|>Human: Thank you for the information about Paris. Can you recommend some popular tourist attractions there?<|fim_gen|>Human: I'm in Paris, France.
Assistant: Ah, Paris! While I can't provide real-time weather information, I can tell you that Paris generally has a temperate climate. May I suggest checking a local weather website or app for the most up-to-date information?
Human: That's a good idea, thanks. While we're on the topic of Paris, can you tell me about some famous landmarks?
Assistant: Certainly! Paris is known for its iconic landmarks. Here are a few famous ones:
1. Eiffel Tower
2. Louvre Museum
3. Notre-Dame Cathedral
4. Arc de Triomphe
5. Sacré-Cœur Basilica<|fim_end|>
In this example, the model needs to understand and generate a coherent conversation that fits between the given start and end points.
| Tasks | Version | Filter | n-shot | Metric | Value | Stderr | ||
|---|---|---|---|---|---|---|---|---|
| tinyBenchmarks | N/A | |||||||
| - tinyArc | 0 | none | 25 | acc_norm | ↑ | 0.5821 | ± | N/A |
| - tinyGSM8k | 0 | flexible-extract | 5 | exact_match | ↑ | 0.4989 | ± | N/A |
| strict-match | 5 | exact_match | ↑ | 0.4867 | ± | N/A | ||
| - tinyHellaswag | 0 | none | 10 | acc_norm | ↑ | 0.8307 | ± | N/A |
| - tinyMMLU | 0 | none | 0 | acc_norm | ↑ | 0.6651 | ± | N/A |
| - tinyTruthfulQA | 0 | none | 0 | acc | ↑ | 0.4991 | ± | N/A |
| - tinyWinogrande | 0 | none | 5 | acc_norm | ↑ | 0.7558 | ± | N/A |
python sft_14.py \
--run_name="llama3.1-8b-continued2" \
--model_name_or_path="meta-llama/Meta-Llama-3.1-8B" \
--dataset_name="mlfoundations/dclm-baseline-1.0-parquet,mlabonne/FineTome-100k" \
--report_to="wandb" \
--optim="adamw_bnb_8bit" \
--lr_scheduler_type="cosine" \
--max_steps=100000 \
--max_seq_length=64000 \
--learning_rate=0.00001 \
--attn_implementation="flash_attention_2" \
--save_strategy="steps" \
--save_steps 50 \
--save_total_limit=10 \
--per_device_train_batch_size=1 \
--per_device_eval_batch_size=1 \
--gradient_accumulation_steps=8 \
--logging_steps=1 \
--num_train_epochs=1 \
--push_to_hub \
--hub_model_id="ericflo/Llama-3.1-8B-ContinuedTraining2-FFT" \
--hub_strategy="all_checkpoints" \
--gradient_checkpointing \
--use_liger=true \
--packing=true \
--torch_dtype="bfloat16" \
--output_dir="continuedtraining2_output"
This model is designed for:
For inquiries about this model, please contact Eric Florenzano through the model repository.