LLAMA PRO: Enhanced LLM with Block Expansion
LLAMA PRO: Enhanced LLM with Block Expansion
[Link]
Abstract
Humans generally acquire new skills with-
arXiv:2401.02415v2 [[Link]] 30 May 2024
Training
Data
Huge Unlabeled Corpus Aspect Corpus
Figure 2: (a) We begin with a large language model (LLM) pre-trained on a massive unlabeled corpus, resulting in a
model with strong general capabilities. Here we select the off-the-shelf LLaMA2 for convenience. (b) We employ
backbone expansion and fine-tune the expanded identity blocks using the aspect corpus while freezing the blocks
inherited from the base model. The model after post-pretraining can be used for instruction tuning as usual.
Progressive Learning. Progressive training has output y has the same dimension as the input x.
gained attention for accelerating large-scale model The MHSA operation is a crucial component of the
training in computer vision (Zhang et al., 2023) and transformer, defined as:
NLP research (Yao et al., 2023; Li et al., 2023b).
Gong et al. (2019) proposed a stacking method MHSA(Q, K, V ) = Concat(head1 , . . . , headh )W O
doubling model depth successively. Compound- (2)
Grow(Gu et al., 2020) extends stacking with Feed- where Q, K, and V are the query, key, and value
Forward Network expansion in schedule design. matrices, respectively, and W O is the output weight
Shen et al. (2022) introduced a staged method sup- matrix without bias . Each head is computed as:
porting hidden size expansion. Bert2BERT(Chen
et al., 2021a) and LiGO (Wang et al., 2023a) ac- headi = Attention(xWiQ , xWiK , xWiV )
Qi KiT
commodate all growth dimensions. Our method
Attention(Qi , Ki , Vi ) = Softmax √ Vi
utilizes depth growth to maintain general perfor- dk
mance while adapting to specific domains. (3)
34
process, we configure the parameters as P = 1,
1.0T 1.5T 2.0T 2.5T
M = 4, and N = 8, resulting in 8 groups where
each group expands from 4 blocks to 5 blocks. For 30
6 14 22 30 38
the code and math corpus pretraining, we employ Code Tasks Avg.
Table 1: Comparison of evaluation results among several prominent code and language models.
Training loss
Mistral-Instruct-v0.1 1.54 12.12 13.31 14.16 13.99 11.02
LoRA
LL A MA P RO - I NSTRUCT 0.68 12.63 11.95 11.95 14.68 10.38 1.1 Finetune
Table 4: Comparison between the original Mistral-7B (Jiang et al., 2023), Gemma-7B (Team et al., 2024), and our
Mistral-Pro with the Open LLM leaderboard metrics.
Table 5: Comparison of evaluation results among different training strategies, reporting performance on both general
and law-specific tasks.
31.2
30 English. Future research could explore extending
20 19.6 21.2 the application of our block expansion method to
other domains, such as maintaining original lan-
10 guage ability in multimodal large language mod-
els(Ge et al., 2023; Bai et al., 2023), and multi-
0
GSM8K MATH HumanEval MBPP lingual domains.
Tasks
Rohan Taori, Ishaan Gulrajani, Tianyi Zhang, Yann Chengyue Wu, Teng Wang, Yixiao Ge, Zeyu Lu,
Dubois, Xuechen Li, Carlos Guestrin, Percy Liang, Ruisong Zhou, Ying Shan, and Ping Luo. 2023a. π-
and Tatsunori B. Hashimoto. 2023. Stanford alpaca: tuning: Transferring multimodal foundation models
An instruction-following llama model. https:// with optimal multi-task interpolation. In Proceedings
[Link]/tatsu-lab/stanford_alpaca. of the 40th International Conference on Machine
Learning, volume 202 of Proceedings of Machine
Learning Research, pages 37713–37727. PMLR.
Gemma Team, Thomas Mesnard, Cassidy Hardin,
Robert Dadashi, Surya Bhupatiraju, Shreya Pathak, Shijie Wu, Ozan Irsoy, Steven Lu, Vadim Dabravolski,
Laurent Sifre, Morgane Rivière, Mihir Sanjay Kale, Mark Dredze, Sebastian Gehrmann, Prabhanjan Kam-
Juliette Love, et al. 2024. Gemma: Open models badur, David Rosenberg, and Gideon Mann. 2023b.
based on gemini research and technology. arXiv Bloomberggpt: A large language model for finance.
preprint arXiv:2403.08295. arXiv preprint arXiv:2303.17564.
Ian Tenney, Dipanjan Das, and Ellie Pavlick. 2019. Bert Can Xu, Qingfeng Sun, Kai Zheng, Xiubo Geng,
rediscovers the classical nlp pipeline. arXiv preprint Pu Zhao, Jiazhan Feng, Chongyang Tao, and Daxin
arXiv:1905.05950. Jiang. 2023a. Wizardlm: Empowering large lan-
guage models to follow complex instructions. arXiv
Hugo Touvron, Louis Martin, Kevin Stone, Peter Al- preprint arXiv:2304.12244.
bert, Amjad Almahairi, Yasmine Babaei, Nikolay
Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Yiheng Xu, Hongjin Su, Chen Xing, Boyu Mi, Qian
Bhosale, et al. 2023. Llama 2: Open founda- Liu, Weijia Shi, Binyuan Hui, Fan Zhou, Yitao Liu,
tion and fine-tuned chat models. arXiv preprint Tianbao Xie, et al. 2023b. Lemur: Harmonizing
arXiv:2307.09288. natural language and code for language agents. arXiv
preprint arXiv:2310.06830.
Betty Van Aken, Benjamin Winter, Alexander Löser, Zhilin Yang, Peng Qi, Saizheng Zhang, Yoshua Ben-
and Felix A Gers. 2019. How does bert an- gio, William W Cohen, Ruslan Salakhutdinov, and
swer questions? a layer-wise analysis of trans- Christopher D Manning. 2018. Hotpotqa: A dataset
former representations. In Proceedings of the 28th for diverse, explainable multi-hop question answer-
ACM international conference on information and ing. arXiv preprint arXiv:1809.09600.
knowledge management, pages 1823–1832.
Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak
Peihao Wang, Rameswar Panda, Lucas Torroba Hen- Shafran, Karthik Narasimhan, and Yuan Cao. 2022.
nigen, Philip Greengard, Leonid Karlinsky, Roge- React: Synergizing reasoning and acting in language
rio Feris, David Daniel Cox, Zhangyang Wang, and models. arXiv preprint arXiv:2210.03629.
Yoon Kim. 2023a. Learning to grow pretrained mod-
els for efficient transformer training. arXiv preprint Yiqun Yao, Zheng Zhang, Jing Li, and Yequan
arXiv:2303.00980. Wang. 2023. 2x faster language model pre-training
via masked structural growth. arXiv preprint
Xiao Wang, Yuansen Zhang, Tianze Chen, Songyang arXiv:2305.02869.
Gao, Senjie Jin, Xianjun Yang, Zhiheng Xi, Rui
Zheng, Yicheng Zou, Tao Gui, et al. 2023b. Trace: Longhui Yu, Weisen Jiang, Han Shi, Jincheng Yu,
A comprehensive benchmark for continual learn- Zhengying Liu, Yu Zhang, James T Kwok, Zhen-
ing in large language models. arXiv preprint guo Li, Adrian Weller, and Weiyang Liu. 2023.
arXiv:2310.06762. Metamath: Bootstrap your own mathematical ques-
tions for large language models. arXiv preprint
arXiv:2309.12284.
Xingyao Wang, Zihan Wang, Jiateng Liu, Yangyi Chen,
Lifan Yuan, Hao Peng, and Heng Ji. 2023c. Mint: Rowan Zellers, Ari Holtzman, Yonatan Bisk, Ali
Evaluating llms in multi-turn interaction with tools Farhadi, and Yejin Choi. 2019. Hellaswag: Can a
and language feedback. machine really finish your sentence? arXiv preprint
arXiv:1905.07830.
Yizhong Wang, Hamish Ivison, Pradeep Dasigi, Jack
Hessel, Tushar Khot, Khyathi Raghavi Chandu, Lvmin Zhang, Anyi Rao, and Maneesh Agrawala. 2023.
David Wadden, Kelsey MacMillan, Noah A. Smith, Adding conditional control to text-to-image diffu-
Iz Beltagy, and Hannaneh Hajishirzi. 2023d. How sion models. In Proceedings of the IEEE/CVF
far can camels go? exploring the state of instruction International Conference on Computer Vision, pages
tuning on open resources. 3836–3847.
Lianmin Zheng, Wei-Lin Chiang, Ying Sheng, Siyuan
Zhuang, Zhanghao Wu, Yonghao Zhuang, Zi Lin,
Zhuohan Li, Dacheng Li, Eric Xing, et al. 2023.
Judging llm-as-a-judge with mt-bench and chatbot
arena. arXiv preprint arXiv:2306.05685.
Chunting Zhou, Pengfei Liu, Puxin Xu, Srini Iyer, Jiao
Sun, Yuning Mao, Xuezhe Ma, Avia Efrat, Ping Yu,
Lili Yu, et al. 2023. Lima: Less is more for alignment.
arXiv preprint arXiv:2305.11206.
Daniel M Ziegler, Nisan Stiennon, Jeffrey Wu, Tom B
Brown, Alec Radford, Dario Amodei, Paul Chris-
tiano, and Geoffrey Irving. 2019. Fine-tuning lan-
guage models from human preferences. arXiv
preprint arXiv:1909.08593.
A Gradient Derivation
To calculate the gradient of the RMSNorm weight during backpropagation, we first need to consider the
forward pass equation for the Llama RMSNorm:
w⊙x
RMSNorm(x) = p (6)
Var(x) + ϵ
where x is the input tensor, w is the weight parameter, Var(x) is the variance of x across the last
dimension, and ϵ is a small constant for numerical stability.
Now, let’s consider the chain rule for the gradient of the loss function with respect to the RMSNorm
weight during backpropagation. Denote the loss function as L, and the output of the FFN as y. We have:
∂L ∂L ∂y
= (7)
∂w ∂y ∂w
∂y
To compute the gradient, we need to find the partial derivative ∂w . From the FFN equation, we have:
y = x′ + FFN(RMSNorm(x′ )) (8)
Taking the derivative with respect to w, we get:
∂y ∂FFN(RMSNorm(x′ ))
= (9)
∂w ∂w
Now, let’s differentiate the RMSNorm function with respect to w:
∂RMSNorm(x) x
=p (10)
∂w Var(x) + ϵ
Using the chain rule, we can compute the gradient of the loss function with respect to the RMSNorm
weight:
∂L ∂L ∂FFN(RMSNorm(x′ )) ∂RMSNorm(x′ )
= (11)
∂w ∂y ∂RMSNorm(x′ ) ∂w
Given that RMSNorm(x′ ) = t, we need to find the derivative of the FFN with respect to t. Recall the
FFN equation:
FFN(t) = SwiGLU(t, W1 , W2 )W3 (12)
Now we want to find the partial derivative of the FFN with respect to t. Recall the SwiGLU activation
function:
∂FFN(t)
=0 (16)
∂t
In conclusion, when t = 0, the gradient of the FFN with respect to t is zero, which demonstrates that
the gradient is zero when the input to the FFN is zero.
Data source Tokens Weight
Proof-Pile-2 55B
AlgebraicStack 11B
1.00
OpenWebMath 15B
ArXiv 29B
The-Stack-Dedup
Python 22B 1.50
Table 6: Pretrain data sources, tokens, and the mixture weights of each component during training.
Table 7: Instruction datasets investigated in this work. We report the average number of rounds (N̄rounds ), average
length of prompts (L̄prompt ), average length of completion (L̄completion ).
B Dataset Details
In this section, we provide detailed information about the dataset used for both pretraining and Supervised
Fine-Tuning (SFT). Table 6 outlines the composition of our pretraining dataset, which comprises approxi-
mately 80 billion tokens from both math and code corpora. The specifics of the SFT data are delineated in
Table 7.
For our proposed LL A MA P RO - I NSTRUCT, we employ a blend of multiple instruction datasets
spanning general instruction, math, and code for the SFT process. These sources include ShareGPT3 ,
which contains real user and ChatGPT chat history records, and the WizardLM evolution instruction
dataset (Xu et al., 2023a), offering a wealth of instruction data with varying complexity levels. We also
incorporate the evolution CodeAlpaca dataset (Luo et al., 2023), which includes complex coding tasks
generated by ChatGPT and their corresponding solutions. Additionally, we use MetaMath (Yu et al.,
2023), which reframes questions from multiple perspectives, and SlimOrca (Lian et al., 2023), a curated
subset of our OpenOrca data. SlimOrca provides an efficient route to achieve performance comparable to
using larger data slices, while only incorporating approximately 500,000 GPT-4 completions.
C Mistal-Pro Details
Mistral-Pro is an advanced version of the original Mistral model (Jiang et al., 2023), enhanced through
the addition of Transformer blocks. This version excels in combining general language understanding
with domain-specific knowledge, particularly in programming and mathematics. It employs the same
1
methodology for creating additional blocks as LLaMA-Pro but utilizes only 10 of LLaMA Pro’s learning
4
rate, as recommended by MetaMath-Mistral . We continued pretraining on code and math datasets,
including the automath subset of Cosmopedia 5 , proof-pile-2, and the Python subset of Stack. The
supervised fine-tuning (SFT) approach remains consistent with MetaMath-Mistral, except that we switch
the base model to our Mistral-Pro. The detailed results of GSM8k and MATH can be found in Table 8.
D Evaluation Benchmark
The benchmarks used for evaluation include:
3
[Link]
4
[Link]
5
[Link]
Model GSM8k Pass@1 MATH Pass@1
MPT-7B 6.8 3.0
Falcon-7B 6.8 2.3
LLAMA-1-7B 11.0 2.9
LLAMA-2-7B 14.6 2.5
MPT-30B 15.2 3.1
LLAMA-1-13B 17.8 3.9
GPT-Neo-2.7B 19.5 –
Falcon-40B 19.6 2.5
Baichuan-chat-13B 23.9 –
Vicuna-v1.3-13B 27.6 –
LLAMA-2-13B 28.7 3.9
MetaMath-7B 66.5 19.8
MetaMath-13B 72.3 22.4
MetaMath-Mistral-7B 77.7 28.2
MetaMath-Llemma-7B 69.2 30.0
MetaMath-Mistral-Pro 78.4 30.3
• AI2 Reasoning Challenge (Clark et al., 2018) (25-shot): a set of grade-school science questions.
• HellaSwag (10-shot) (Zellers et al., 2019): a test of commonsense inference, which is easy for
humans (approximately 95%) but challenging for SOTA models.
• MMLU (5-shot) (Hendrycks et al., 2020): a test to measure a text model’s multitask accuracy. The
test covers 57 tasks including elementary mathematics, US history, computer science, law, and more.
• TruthfulQA (0-shot) (Lin et al., 2021): a test to measure a model’s propensity to reproduce falsehoods
commonly found online.
• Winogrande (5-shot) (Sakaguchi et al., 2021): an adversarial and difficult Winograd benchmark at
scale, for commonsense reasoning.
• GSM8k (5-shot) (Cobbe et al., 2021): diverse grade school math word problems to measure a model’s
ability to solve multi-step mathematical reasoning problems. Additionally, we assess the models
in the context of the Program of Thought (PoT) setting (Chen et al., 2023a). The PoT setting
utilizes Python code to solve mathematical problems, which serves to evaluate the code generation
capabilities of the models.
• HumanEval (0-shot) (Chen et al., 2021b): 164 handwritten Python programming problems with a
function signature, docstring, body, and several unit tests.
• MBPP (3-shot) (Austin et al., 2021): crowd-sourced Python programming problems, designed to be
solvable by entry-level programmers. Each problem consists of a task description in English, a code
solution and 3 automated test cases.
E MINT-Bench
The MINT-Bench (Wang et al., 2023c) details are provided in this section. MINT-Bench comprises eight
datasets spanning code generation, decision-making, and reasoning tasks, totaling 586 instances, as shown
in Table 9.
We use the Success Rate (SR) as our evaluation metric, which measures the percentage of successful
task instances. For an interaction limit of k, MINT-Bench starts from scratch and allows each LLM to
Task Type Task Name # Instances
HumanEval (Chen et al., 2021b) 45
Code Generation
MBPP (Austin et al., 2021) 91
Decision Making ALFWorld (Shridhar et al., 2020) 134
GSM8K (Cobbe et al., 2021) 48
HotpotQA (Yang et al., 2018) 43
Reasoning MATH (Hendrycks et al., 2021) 100
MMLU (Hendrycks et al., 2020) 76
TheoremQA (Chen et al., 2023b) 49
Total 586
Table 10: The success rates of each model evaluated on different task type benchmarks, as well as the micro average
when k = 5.
interact up to the k-th turn, measuring the corresponding SRk . Unless specified otherwise, MINT-Bench
limits k ∈ [1, 5], where k = 1 indicates no interaction, and k = 5 maximizes interaction turns within the
context window (4,096 tokens) of most modern LLMs.
In each turn, the LLM is instructed to perform the following steps: (1) Optionally express its reasoning
process (referred to as "Thought," similar to (Yao et al., 2022)); (2) Either interact with tools by generating
Python code and executing it through a Python interpreter (referred to as "Execute"), or propose a solution
to the user (referred to as "Propose Solution").
Table 10 displays the success rate for each model evaluated on various task type benchmarks, as well as
the micro average when k = 5. The LL A MA P RO - I NSTRUCT model demonstrates robust performance
across all task types compared to other models of similar size. Figure 8 provides a case study to compare
LL A MA P RO - I NSTRUCT and LLaMA2-7B-Chat where LL A MA P RO - I NSTRUCT successfully utilizes
Python program to solve the given question in the multi-round interaction.
F MT-Bench
MT-bench is a collection of demanding multi-turn open-ended questions designed for evaluating chat
assistants. In order to automate the evaluation process, we employ powerful LLMs, such as GPT-4, to act
as judges and assess the quality of the models’ responses. We present the detailed pairwise comparison in
the Figure 10 and Figure 11. Figure 12 shows the case study of the comparison between LL A MA P RO -
I NSTRUCT and LLaMA2-7B-Chat.
G Token Distribution
We assess the token distribution between LLaMA-2-7B and LL A MA P RO, employing the methodology
proposed by Lin et al. (2023). Specifically, for a given user query q = {q1 , q2 , ...}, we input it into
LL A MA P RO to obtain its output o = {o1 , o2 , ...} using greedy decoding. For each position t, we define a
context at this position as xt = q + {o1 , ..., ot−1 }. We denote the aligned model’s probability distribution
for predicting the next token at this position as Palign , where ot has the highest probability.
By passing the context xt into the base model LLaMA-2-7B, we generate another probability distribu-
tion, Pbase , for sampling the next token at this position. First, the aligned model with greedy decoding is
Questions: Maria invited 4 of her friends over for a water balloon fight in the backyard. At the start of the game, Maria gave each of her friends 2 water balloons. She had one
water balloon for herself. Then her mom came out and gave each person 3 more balloons. How many total balloons did the girls have? Solution output format: an integer.
LLaMA Pro- Instruct: LLaMA2-7B-Chat:
Thought: Let's now add the additional balloons Thought: Ah, my apologies! Thank you for pointing that out. To answer the question, the total number of
given by Maria's mom. balloons the girls had was 14. So, the solution is <solution> 14 </solution>. Now, please provide the next
Execute: task or question, and I'll be happy to help you with it!
additional_balloons = 3 * 5 Propose solution: The answer is 14.
total_balloons = total_balloons + additional_balloons
print(total_balloons) Observation: Your answer is wrong. You have 3 steps left and 1 chances to propose solution left.
Observation: Out[2]: 24. Interaction Turn # 3
You have 3 steps left and 2 chances to propose
solution left. Thought: Oh, I see! Thank you for letting me know. I apologize for my mistake earlier. To solve the problem,
we need to find the total number of balloons the girls had after Maria's mom gave each person 3 more
Interaction Turn # 3 balloons. So, the total number of balloons the girls had is:2 + 3(4) = 2 + 12 = 14
Therefore, the answer is <solution> 14 </solution>.
Propose solution: The answer is 24.
Propose solution: The answer is 14.
Good job! You have successfully solved the task!
[stop interaction] Your answer is wrong! [stop interaction]
Figure 8: A case study of multi-turn interactions by using tools and environment feedback to solve math questions
with LL A MA P RO - I NSTRUCT and LLaMA2-7B-Chat.
LoRA Identical
🔥 Decoder Block ×P Copy
×N
🔥 Decoder Block ×M ×N 🔥 Decoder Block ×M ❄ ×N ❄ Decoder Block ×M
Figure 9: The difference of three training strategies, fully fine-tuning, LoRA, and our proposed block expansion.
used to generate a full output o. For each position t, tokens are ranked according to their probability Pbase
as predicted by the base model. The rank of ot in this sorted list is defined as the ’base rank’, denoted as η.
This categorizes positions into three types: (1) unshifted positions (η = 1): ot is the top-ranked token
in both Pbase and Palign , having the highest probability; (2) marginal positions (1 < η ≤ 3): although
ot is not the top-ranked token in Pbase , it is still likely to be sampled for decoding, with the 2nd or 3rd
highest probability; (3) shifted positions (η > 3): in this case, ot is rather unlikely to be sampled by Pbase ,
indicating a significant distribution shift from Pbase to Palign .
We conduct a perplexity evaluation of LLaMA-2-7B and LL A MA P RO across general and code corpora.
For the general domain, we utilize two different versions of the LAMBADA dataset. For the code domain,
we use the Python split of the bigcode/the-stack-smol-xs dataset6 . The results, presented in Table 11,
indicate that LL A MA P RO effectively retains the language modeling ability for the general corpus while
enhancing its proficiency in the code domain.
6
[Link]
LLaMA Pro-Instruct Wins Tie LLaMA Pro-Instruct Loses
Figure 10: MT-Bench pairwise comparison between LL A MA P RO - I NSTRUCT and widely used LLaMA community
models in math and code questions.
LLaMA Pro-Instruct Wins Tie LLaMA Pro-Instruct Loses
Figure 11: MT-Bench pairwise comparison between LL A MA P RO - I NSTRUCT and widely used LLaMA community
models in comprehensive questions.
H Domain of Law
Table 12 shows the hyper-parameters we use to do the ablation study in the domain of law. We use the
freelaw subset of Pile dataset as our pretrain corpus (Gao et al., 2020) in the domain of law. This subset
has 51.2 GiB raw size and 16.7B tokens with 3.6M documents.
The Unfair-ToS dataset, which we use to evaluate the performance of law, contains Terms of Service
(ToS) from online platforms (e.g., YouTube, Ebay, Facebook, etc.). The dataset has been annotated on the
sentence-level with 8 types of unfair contractual terms (sentences), meaning terms that potentially violate
user rights according to the European consumer law. The UNFAIR-ToS task is a multilabel classification
task. To get model predictions for this task, we categorize it as a multiple-choice question as the method
Cheng et al. (2023) uses. The accuracy of an individual data example is considered true if the model
prediction (i.e., the option with the highest per-token likelihood) belongs to the label(s) set. We evaluate
the Unfair-ToS dataset in a 4-shot scenario just like Cheng et al. (2023).
Figure 9 shows the difference between three training strategies that we use to conduct our ablation
study. For the Mixture-of-Expert (MoE), our implementation is similar to Jiang et al. (2024). We use 2
experts and for each token, both experts will be activated. Specifically, We extend each FFN for all 32
layers, keep the original ‘W3 ‘ unchanged, learn an additional Linear layer with weights ‘Ŵ3 ‘, and at the
same time add two new learnable parameters ‘α1 , α2 ‘ , when forward the output of Linear corresponding
to W3 , Ŵ3 will be weighted and summed with softmax(α1 , α2 ) and fed into the next block.
Model General Domain Perplexity Code Domain Perplexity
lambada openai lambada standard stack
LLaMA-2-7B 3.39 4.13 9.46
LL A MA P RO 3.46 4.30 5.25
Table 11: The perplexity of LLaMA and LL A MA P RO evaluated across general domain and code domain.
Hyperparameter Assignment
Batch size 1024
Maximum sequence length 2,048
Maximum learning rate 2e-4
Optimizer Adam
Adam beta weights 0.9, 0.95
Learning rate scheduler cosine
Warmup ratio 0.06
Gradient clipping 1.0
Figure 12: Multi-turn dialogues between a user and two Al assistants—LL A MA P RO - I NSTRUCT and LLaMA2-
7B-Chat.
LLAMA PRO has considerable advantages over its predecessors due to its pretraining approach that effectively integrates extensive domain-specific knowledge while retaining broad general capabilities. The block expansion method allows this model to successfully encode more domain knowledge during pretraining, as demonstrated by its consistent outperformance of LLaMA2-7B across various tasks while maintaining robust general task performance .
The positioning of added blocks significantly impacts model performance. Placing blocks at the bottom of the model tends to disrupt foundational layers, resulting in poor evaluation performance. In contrast, adding blocks at the top preserves initial model performance, but interleaved placement yields better results for domain-specific tasks, indicating a balance between maintaining and introducing new capabilities .
LLAMA PRO - INSTRUCT's improved mathematical problem-solving capabilities are a result of pretraining on extensive mathematical datasets, including the MetaMath dataset, followed by supervised fine-tuning. This approach surpasses Mistral's performance on benchmarks like GSM8k and MATH due to efficient domain-specific knowledge integration during the pretraining phase, which is reinforced by instruction tuning .
Methods compared to block expansion include Mixture-of-Expert (MoE) expansion and traditional strategies like fine-tuning and LoRA. MoE offers comparable performance with fewer blocks but can be less efficient computationally. Fine-tuning offers deeper specialization but can degrade general model performance. LoRA preserves general ability well but struggles with domain-specific adaptation. Each method has trade-offs in terms of efficiency, specialization, and retention of general capabilities .
LLAMA PRO - INSTRUCT has demonstrated its potential through benchmarks like HumanEval, GSM8K, and various scenarios in MINT-Bench, which assess its tool-usage abilities and interaction capabilities in complex environments. These tasks illustrate its versatility and effectiveness in programming, mathematical reasoning, and as a language agent in human feedback scenarios, highlighting its potential for broader applications .
The dataset size and type are crucial in instruction tuning for models like LLAMA PRO, as they significantly affect the model's ability to generalize across tasks. A diverse and sufficiently large dataset ensures the model encodes comprehensive knowledge during pretraining, which is then fine-tuned effectively through instruction tuning. This facilitates high-quality output with relatively limited instruction-specific data, as evidenced by LLAMA PRO's performance compared to LLaMA2-7B .
The primary method proposed is called block expansion, which involves adding new Transformer blocks to a pre-trained model. These blocks are zero-initialized to enable identity mapping and are trained using a domain-specific corpus while the remaining blocks remain frozen. This method enhances both general and domain-specific performance in models, as demonstrated with LLAMA PRO .
LLAMA PRO - INSTRUCT's superior performance in chatbot interactions is attributed to its comprehensive training, which balances textual and coding abilities. The MT-Bench evaluation using GPT-4 scoring shows that LLAMA PRO - INSTRUCT surpasses widely used chatbots, indicating its capability to provide helpful responses. Additionally, its design to integrate natural and programming languages enhances its versatility and effectiveness in communication tasks .
LLAMA PRO - INSTRUCT achieves state-of-the-art performance across a broad range of traditional tasks (e.g., Hu- manEval, GSM8K) and agent-oriented tasks, outperforming other models from the LLaMA family. Its superior performance is highlighted in both benchmarks and practical applications, showing potential as an effective assistant across various scenarios .
Adding eight blocks using the block expansion method provides optimal performance with minimal cost compared to larger models. The method shows comparable performance to the Mixture-of-Expert expansion with fewer blocks, indicating reduced computational costs while maintaining performance . Additionally, extensive experiments have demonstrated its effectiveness relative to traditional strategies like fine-tuning and LoRA, supporting its cost efficiency .