LLMLingua and LongLLMLingua parameters question
I read the issue #7, #12 and #49,
I guess the right papameters that LLMLingua uses are :
prompt = compressor.compress_prompt( context=xxx, instruction=xxx, question=xxx, ratio=0.75, iterative_size=100, context_budget="*2", ) ,
and LongLLMLingua is
prompt = compressor.compress_prompt( context=xxx, instruction=xxx, question=xxx, ratio=0.75, iterative_size=200, condition_compare=True, condition_in_question='after_condition', rank_method='longllmlingua', reorder_context='sort', dynamic_context_compression_ratio=0.3, context_budget="*2", )
I have some questions:
- In #7 , you said
context_budgetshould be*1.3or+300in LongLLMLingua, and #12 ,you saidcontext_budgetshould be+200in LongLLMLingua, so I am confused by the setting ofcontext_budget, and meanwhile, in the LLMLingua and LongLLMLingua papers, thecontext_budgetseems to be*2(in #49). So I want to know how to setcontext_budgetin LLMLingua and LongLLMLingua. - in #49, you said
context_budgetandtoken_budget_ratiocan be considered part of the control coefficient parameterk. Can I think I just need to control thecontext_budget? Because in #7 and #12, you do not change thetoken_budget_ratio. - What does
dynamic_context_compression_ratioparameter correspond to in LongLLMLingua paper? I do not find it in the implementation details. - The most important thing I want to know is whether the parameters I describes above are correct, and I want to get your LLMLingua and LongLLMLingua parameters you used actually in the paper, and i want to use TRUE parameters to run LLMLingua and LongLLMLingua experiments.
Please forgive my too long questions, because your LLMLingua and LongLLMLingua work are very interesting for me! Looking forward to your reply.
Hi @XiaoFengbing,
Thank you for your question. I've shared the parameters we used in LongLLMLingua in issues #7 and #12, which you can refer to.
- In fact, as I mentioned in issue #49, the "granular control coefficient" k in the paper equals “context_budget” plus “token_budget_ratio”. In LongLLMLingua, we mostly use “context_budget” = “+200”, whereas in LLMLingua, it’s “context_budget” = “*1.5”.
- You can leave “token_budget_ratio” unchanged for most tasks.
- The “dynamic_context_compression_ratio” corresponds to δτ in Equation(5) of the LongLLMLingua paper.
- If you have more questions, please feel free to ask.
Hi, @iofu728, thanks for your response very much!
-
I confused about
context_budgetafter reading #7 and #12.
context_budgetare different number in LongLLMLingua, so i am confused. So I will setcontext_budgetto be+200in LongLLMLingua, thanks! -
I see
dynamic_context_compression_ratioseems to be0.25by default in LongLLMLingua paper B.2 OTHER IMPLEMENTATION DETAILS. I am confused why it is set to be0.3or0.4in #7 and #12. -
Thanks for the LongLLMLingua parameters you shared in issues #7 and #12. I want to know the LLMLingua parameters you used——
prompt = compressor.compress_prompt( context=xxx, instruction=xxx, question=xxx, ratio=0.75, iterative_size=100, context_budget="*1.5", )Is it right?
Hi @XiaoFengbing, sorry for the late reply.
- Yes, we stated in the paper that it's 0.25. However, for tasks like MultiDocument QA, a setting of 0.3 or 0.4 tends to perform better.
- That matches the parameters I use.