LLMLingua-2: Learn Compression Target via Data Distillation for Efficient and Faithful Task-Agnostic Prompt Compression

Microsoft Corporation
{qianhuiwu, hjiang, xufang.luo}@microsoft.com

News

  1. 🍩  [24/12/13] We are excited to announce the release of our KV cache-centric analysis work, SCBench, which evaluates long-context methods from a KV cache perspective.

  2. πŸ‘˜  [24/09/16] We are pleased to announce the release of our KV cache offloading work, RetrievalAttention, which accelerates long-context LLM inference via vector retrieval.

  3. πŸŒ€  [24/07/03] We're excited to announce the release of MInference to speed up Long-context LLMs' inference, reduces inference latency by up to 10X for pre-filling on an A100 while maintaining accuracy in 1M tokens prompt! For more information, check out our paper, visit the project page.

  4. 🦚  We're excited to announce the release of LLMLingua-2, boasting a 3x-6x speed improvement over LLMLingua! For more information, check out our paper, visit the project page, and explore our demo.

  5. πŸ‘Ύ  LLMLingua has been integrated into LangChain and LlamaIndex, two widely-used RAG frameworks.

  6. 🀳  Talk slides are available in AI Time Jan, 24.

  7. πŸ–₯  EMNLP'23 slides are available in Session 5 and BoF-6.

  8. πŸ“š  Check out our new blog post discussing RAG benefits and cost savings through prompt compression. See the script example here.

  9. πŸ‘¨β€πŸ¦―  Explore our './examples' directory for practical applications, including LLMLingua-2, RAG, Online Meeting, CoT, Code, and RAG using LlamaIndex.



Abstract

LLMLingua-2 focuses on task-agnostic prompt compression for better generalizability and efficiency. Considering the redundancy in natural language, existing approaches compress prompts by removing tokens or lexical units according to their information entropy obtained from a causal language model such as LLaMa-7B. The challenge is that information entropy may be a suboptimal compression metric: (i) it only leverages unidirectional context and may fail to capture all essential information needed for prompt compression; (ii) it is not aligned with the prompt compression objective.

To address these issues, we propose a data distillation procedure to derive knowledge from an LLM to compress prompts without losing crucial information, and meantime, introduce an extractive text compression dataset. We formulate prompt compression as a token classification problem to guarantee the faithfulness of the compressed prompt to the original one, and use a Transformer encoder as the base architecture to capture all essential information for prompt compression from the full bidirectional context. Our approach leads to lower latency by explicitly learning the compression objective with smaller models such as XLM-RoBERTa-large and mBERT.

We evaluate our method on both in-domain and out-of-domain datasets, including MeetingBank, LongBench, ZeroScrolls, GSM8K, and BBH. Despite its small size, our model shows significant performance gains over strong baselines and demonstrates robust generalization ability across different LLMs.


Insights

  1. Natural language is redundant, amount of information varies.

  2. LLMs can understand compressed prompt.

  3. GPT-4 can perform high quality, extractive prompt compression using carefully designed instruction and chunking. (LLMLingua-2)

  4. Prompt compression can be formulated as a token classification problem and accomplished by a BERT sized compressor. (LLMLingua-2)

  5. Meetingbank-trained compressors generalize well to other domain data. (LLMLingua-2)

For more details, please refer to the paper LLMLingua-2.


Why LLMLingua-2?

Challenges Encountered in Information Entropy Based Methods​:
  1. πŸ€”  Perplexity or information entropy may be suboptimal for prompt trimming: Not aligned with the prompt compression objective.

  2. πŸ€–   How can we identify or build a suitable dataset to align the SLM towards effective prompt compression?
  3. ➑️  Importance of tokens is context-dependent. Causal LMs only leverage unidirectional context, which may fail to capture all essential information within the context.

  4. πŸ”„   How can we design a compression algorithm that effectively leverage the full bidirectional context?

Why Data Distillation?

Shortcomings of Existing Text Compression Datasets ​:
  1. 😒   Most text compression datasets are abstractive, which leads to slow autoregressive process and may produce hallucinated content.

  2. πŸ€·β€β™‚οΈ   Extractive compression datasets such as SentComp and DebateSum are mainly created for the summarization task and often lack detailed information. In the case of prompt compression, we should retain essential information as much as possible.



Methodology

To address the challenges in existing entropy-based prompt compression methods, LLMLingua-2 employs a data distillation procedure, which involves extracting knowledge from an LLM (GPT-4) to compress texts without losing crucial information or introducing hallucinated content.


Instruction Design

A well-crafted instruction is the key to unveiling the compression capabilities of GPT-4. To ensure that the generated texts stay faithful to the original, we explicitly instruct GPT-4 to compress the text by discarding unimportant words in the original texts only and not adding any new words during generation.



Annotation & Filtering

Leveraging the distilled knowledge from the LLM, we design a data annotation algorithm, which assigns labels to each word in the original text to indicate whether it should be preserved after compression. To ensure the quality of the constructed dataset, we propose two quality control metrics to filter out low-quality samples. For more details, please refer to the Sec. 3 of our LLMLingua-2 paper.



Compressor

Finally, we formulate prompt compression as a token classification problem and employ a Transformer encoder as the feature extractor to capture all essential information for prompt compression from the full bidirectional context. After training on the constructed dataset, we determine whether to preserve or discard each token in the original prompt based on its probability calculated by our classification model.


Performance

We evaluate LLMLingua-2 on both in-domain and out-of-domain datasets, including various tasks such as in-context learning, summarization, conversation, multi-document QA, single-document QA, code, and synthetic tasks. The results indicate that our approach can achieve minimal performance loss and outperform the SOTA task-agnostic prompt compression methods.

  • ●   In-Domain (MeetingBank)
  • Below, we present the results of LLMLingua-2 compared to the strong baselines on In-Domain data: the test set of MeetingBank. Despite the fact that our compressors are much smaller than the LLaMa-2-7B used in the baselines, our approach achieves significantly better performance on both the QA and Summary tasks, and comes close to matching the performance of the original prompt.
  • ●   Out-of-Domain (LongBench, GSM8K and BBH)
  • As our model is only trained on meeting transcripts data from MeetingBank, here we explore its generalization ability across various benchmarks of long-context scenarios, reasoning, and in-context learning. Although the compressor of LLMLingua-2 is only trained on MeetingBank data, our comprehensive experiments validate its effectiveness on out-of-domain datasets, with its performance comparable to or even surpassing the SOTA task-agnostic compression baselines.

Cases Studies

We conduct a series of case studies on both in-domain and out-of-domain datasets, including various tasks such as document-based QA, summarization, retrieval-augmented QA and in-context learning. We find that LLMLingua-2 effectively preserves the informative words in the original context. Below, we showcase several compression results on both in-domain and out-of-domain datasets to provide readers with a clearer understanding of LLMLingua-2's capability.

πŸ“ Online Meeting QA

Using generative AI like ChatGPT in online meetings can greatly improve work efficiency (e.g., Teams). However, the context in such applications tends to be more conversational, with a high degree of redundancy and a large number of tokens(more than 40k). By utilizing LLMLingua-2 to compress prompts, we can significantly reduce the length of prompts, which in turn helps to reduce latency. This makes the AI more efficient and responsive in real-time communication scenarios like online meetings, enabling smoother interactions and better overall performance. We use meeting transcripts from the MeetingBank dataset as an example to demonstrate the capabilities of LLMLingua-2.
In Online Meeting QA task, we firstly instruct GPT-4 to generate QA pairs based on the original meeting transcript, then query GPT-3.5-Turbo with the compressed meeting transcript.


Method Prompt Tokens Response
Original John: So, um, I've been thinking about the project, you know, and I believe we need to, uh, make some changes. I mean, we want the project to succeed, right? So, like, I think we should consider maybe revising the timeline.
Sarah: I totally agree, John. I mean, we have to be realistic, you know. The timeline is, like, too tight. You know what I mean? We should definitely extend it.
Question: What does Sarah think about the timeline?
Answer:
98 Sarah thinks that the timeline is too tight and needs to be extended to be more realistic.
LLMLingua2 John: I've been thinking about project believe we need to make changes. want project to succeed right? should consider revising timeline.
Sarah: agree, John. have to be realistic. timeline too tight.? should extend it.
Question: What does Sarah think about the timeline?
Answer:
46
(2x)
Sarah thinks that the timeline for the project is too tight and suggests extending it to be more realistic.
Original Madam Court, could you please read docket 1239? Certainly. Docket 1239. The Committee on Government Operations, to which was referred on December 1st, 2021, docket number 1239 message an order authorizing the creation of a sheltered market program in conformity with the requirements of general laws. Chapter 30 B Section 18. This authorization applies to contracts for goods, professional services and support services. This authorization is for no more than six contracts, which must be awarded by June 30th, 2022. This sheltered market program shall be available for disadvantaged, minority and women only vendors, for whom there is a demonstrated substantial disparity in the city's 2020 disparities. Study submits a report recommending the order ought to pass. Thank you so much, Madam Clerk. The Chair recognizes Councilor Edwards, chair of the committee. Councilor Edwards. You have the floor. This is this is actually a matter, I believe, sponsored by the. Mayor in Cannes. In conformance with the recommendations from the disparity study and making sure that we opt in to this this pilot program under mass general laws 30 Section 18. Again, it's really just following the recommendations of an already studied issue, which which demonstrates a disparity between minority contractors or women contractors receiving contracts in the city of Boston. So this would allow for us to shepherd and move these six contracts to those already designated groups who have a disadvantage. And I think it's. Really fulfilling a promise. Of making sure that we go through and make sure all aspects of the city government, including the financial benefits, are accessible to people in the city of Boston. I recommend that this pass and I hope that my colleagues will vote for it. Thank you. Thank you so much. Councilor Edward seeks acceptance of the committee report and passage of Docket 1239. Madam Court, could you please call the roll? Certainly. Docket 1239. Councilor Arroyo. Yes. Councilor Arroyo. Yes. Councilor Baker. Councilor Baker. Councilor. Councilor Barker. Council Braden. Councilor Braden. Councilor Campbell. Councilor Campbell. Yes. Councilor Edwards. Yes. Councilor Sabby. George. Councilor Sabby. George. He has Councilor Flaherty. Councilor Flaherty as Councilor Flynn. Councilor Flynn. Yes. Councilor Jane. Yes. Councilor Janey. As Councilor me here. Councilor me here as Councilor Murphy. Councilor Murphy. Yes. And Councilor O'Malley. Yes. Councilor O'Malley. Yes. Madam President, do I get number 1239 has received unanimous vote. Thank you so much. Dockett 1239 has passed and now we will move on to matters recently heard for possible action. Madam Clerk, if you could please read docket 0863. Certainly Docket 0863 order for hearing to discuss pest control and illegal dumping in the city of Boston.
Question: What is the subject of Docket 0863?
Answer:
626 The subject of Docket 0863 is an order for a hearing to discuss pest control and illegal dumping in the city of Boston.
LLMLingua2
Madam Court read docket 1239? Committee Government Operations referred December 1st 2021 sheltered market program laws Chapter 30 B Section 18. contracts goods services six contracts June 30th 2022 disadvantaged minority women vendors disparity city 2020 disparities order pass Chair recognizes Councilor Edwards sponsored Mayor disparity study pilot program laws 30 Section 18. disparity minority women contractors Boston six contracts groups government financial benefits Boston recommend pass colleagues vote seeks acceptance report passage Docket 1239 call roll? Docket 1239 Councilor Arroyo BakerCouncilor Flaherty Flynn Murphy O'Malley Madam President 1239 unanimous vote 1239 passed Madam Clerk read docket 0863 pest control illegal dumping Boston
Question: What is the subject of Docket 0863?
Answer:
151
(4x)
The subject of Docket 0863 is "pest control and illegal dumping in Boston."
Original H adoption of resolution limiting natural gas infrastructure for new residential construction on city owned property. And we do have one speaker on this. Okay. Oh, well, we take our public speaker first. Public speaker. Come on it. Melissa, you. Hi councilmembers. My name is Melissa. You and I am with the Sierra Club. I'm here today to support this resolution, and I'm going to keep my comments short because hopefully you all have read our long support letter highlighting all the reasons why you all should support this. And so I'm excited to be here and I hope that this resolution passes unanimously, because if this passes, Alameda would actually be the 15th city in California to move forward towards being gas free and buildings. And I am also looking forward to seeing how the city continues to find ways to broaden the ordinance to consider not only city properties, but also properties not owned by the city. So thank you. Thank you. And that was the only public speaker. Okay, discussion or motion. I'll make a motion. I just want to. But I want to thank Assistant City Manager. Oh, you know what? Actually, this is one. I'm sorry to interrupt you, Vice Mayor, but this is one where. Go ahead. Yeah, well, no, because you remember that little city manager mentioned this at the beginning. There was a change. I think we even got an email there. Just for public. So they know exactly what you're making a motion on. We circulated. We want to just make a few small changes. So I don't want to talk about right now. Just quickly point out for you and the public the changes from what's before you then from what went out ten days ago and I'm sorry the one we just we we I met to get you the strike out version but the basic changes where we left we deleted a reference to San Bruno in the paragraph about gas infrastructure and earthquakes. That was not an earthquake issue. That was a construction issue. We eliminated a reference to the 14,000 tons that would be saved by this. Rizzo That was a miss. That was not correct. That's if we that's that's what would be saved by a larger effort citywide. And then we added, probably most importantly, an additional finding, which really deals with the fact that we are going to have a natural gas infrastructure with us for quite a while still. And we need to be thinking about the jobs and the people who work on that, that they we will still need them. And we need to think about how we convert those jobs over time to we will always need utility jobs. They may not be natural gas, it may be non-fossil fuel utilities. So I just wanted everybody to know what we changed since it went out in the packet. Thank you. Okay. Vaisman. I was just going to give my thanks to Assistant City Manager Bowden for his work on this and Andrew and his team. I know you guys move very fast in this and it was great to see it happen. So thank you very much. And with that, I'd like to move approval. Okay, we have a motion and then we have discussion. I just also want to say thank you. I mean, it's good to see that something in our climate action plan is is actually getting done. So I appreciate that a lot. Yeah. And and I hope some of you at least cut the the op ed that the mayor of Berkeley and I did about building electrification. That was in the Chronicle a couple of weeks ago. Okay. We have a motion. We have a second on favor. I opposed any abstain hearing and that motion passes unanimously. Thank you. All right. It's 833 and we finished the consent calendar. So moving right along. Item six A public hearing to consider adoption of resolution amending the general plan business park classification to clarify the allowable floor area ratio at Harvard Bay Business Park as recommended by the City Planning Board.
Question: Who is the speaker from the public?
Answer:
820 The speaker from the public in this conversation is Melissa Yu, who is representing the Sierra Club.
LLMLingua2
adoption resolution limiting natural gas infrastructure new residential construction city property. one speaker. public speaker first. Melissa. Sierra Club. support resolution comments short support letter. excited hope resolution passes unanimously Alameda 15th city California gas free. looking forward city broaden ordinance consider city properties not city. thank you. only public speaker. discussion motion. Assistant City Manager.?. manager change. email. public. motion few small changes. changes deleted reference San Bruno gas infrastructure earthquakes. not earthquake. construction issue. eliminated reference 14,000 tons saved. larger effort citywide.added additional finding natural gas infrastructure. jobs. convert jobs utility jobs. not natural gas non-fossil fuel utilities. changed packet. thanks Assistant City Manager Bowden Andrew team. fast approval. motion discussion. climate action plan done. op mayor Berkeley building electrification. Chronicle motion. second favor. passes unanimously. finished consent calendar. Item six public hearing resolution amending general plan business park classification allowable floor area ratio Harvard Bay Business Park City Planning Board.
Question: Who is the speaker from the public?
Answer:
204
(4x)
The speaker from the public is Melissa, representing the Sierra Club.

✍️ Online Meeting Summary

In addition to QA, LLMs can also be employed to summarize lengthy meeting transcripts. To assess the effectiveness of the compressed meeting transcripts for summarization, we conducted experiments on the summary task using the MeetingBank dataset.
In Online Meeting Summary task, we showcase GPT-3.5-Turbo's summary given the compressed meeting transcript.


Method Prompt Tokens Response
Original Summarize the following meeting transcript (which may be compressed):
John: So, um, I've been thinking about the project, you know, and I believe we need to, uh, make some changes. I mean, we want the project to succeed, right? So, like, I think we should consider maybe revising the timeline.
Sarah: I totally agree, John. I mean, we have to be realistic, you know. The timeline is, like, too tight. You know what I mean? We should definitely extend it.
Your summary:

98 John suggests making changes to the project timeline to ensure its success. Sarah agrees, emphasizing the need for realism and proposing an extension of the timeline due to its tightness.
LLMLingua2 Summarize the following meeting transcript (which may be compressed)::
John: I've been thinking about project believe we need to make changes. want project to succeed right? should consider revising timeline.
Sarah: agree, John. have to be realistic. timeline too tight.? should extend it.
Your summary:

46
(2x)
John proposes revising the timeline for Project Believe, emphasizing the need for changes to ensure its success. Sarah agrees, suggesting that the current timeline is unrealistic and advocating for an extension.
Original Summarize the following meeting transcript (which may be compressed):
Madam Court, could you please read docket 1239? Certainly. Docket 1239. The Committee on Government Operations, to which was referred on December 1st, 2021, docket number 1239 message an order authorizing the creation of a sheltered market program in conformity with the requirements of general laws. Chapter 30 B Section 18. This authorization applies to contracts for goods, professional services and support services. This authorization is for no more than six contracts, which must be awarded by June 30th, 2022. This sheltered market program shall be available for disadvantaged, minority and women only vendors, for whom there is a demonstrated substantial disparity in the city's 2020 disparities. Study submits a report recommending the order ought to pass. Thank you so much, Madam Clerk. The Chair recognizes Councilor Edwards, chair of the committee. Councilor Edwards. You have the floor. This is this is actually a matter, I believe, sponsored by the. Mayor in Cannes. In conformance with the recommendations from the disparity study and making sure that we opt in to this this pilot program under mass general laws 30 Section 18. Again, it's really just following the recommendations of an already studied issue, which which demonstrates a disparity between minority contractors or women contractors receiving contracts in the city of Boston. So this would allow for us to shepherd and move these six contracts to those already designated groups who have a disadvantage. And I think it's. Really fulfilling a promise. Of making sure that we go through and make sure all aspects of the city government, including the financial benefits, are accessible to people in the city of Boston. I recommend that this pass and I hope that my colleagues will vote for it. Thank you. Thank you so much. Councilor Edward seeks acceptance of the committee report and passage of Docket 1239. Madam Court, could you please call the roll? Certainly. Docket 1239. Councilor Arroyo. Yes. Councilor Arroyo. Yes. Councilor Baker. Councilor Baker. Councilor. Councilor Barker. Council Braden. Councilor Braden. Councilor Campbell. Councilor Campbell. Yes. Councilor Edwards. Yes. Councilor Sabby. George. Councilor Sabby. George. He has Councilor Flaherty. Councilor Flaherty as Councilor Flynn. Councilor Flynn. Yes. Councilor Jane. Yes. Councilor Janey. As Councilor me here. Councilor me here as Councilor Murphy. Councilor Murphy. Yes. And Councilor O'Malley. Yes. Councilor O'Malley. Yes. Madam President, do I get number 1239 has received unanimous vote. Thank you so much. Dockett 1239 has passed and now we will move on to matters recently heard for possible action. Madam Clerk, if you could please read docket 0863. Certainly Docket 0863 order for hearing to discuss pest control and illegal dumping in the city of Boston.
Your summary:

626 During the meeting, Docket 1239 was discussed, which pertains to the authorization of a sheltered market program in Boston. The program aims to address disparities in contract awards by providing opportunities for disadvantaged, minority, and women-owned vendors. Councilor Edwards, chair of the committee, emphasized the importance of implementing the program in accordance with the findings of a disparity study. The council unanimously passed Docket 1239, moving onto the next agenda item.
LLMLingua2
Summarize the following meeting transcript (which may be compressed):
Madam Court read docket 1239? Committee Government Operations referred December 1st 2021 sheltered market program laws Chapter 30 B Section 18. contracts goods services six contracts June 30th 2022 disadvantaged minority women vendors disparity city 2020 disparities order pass Chair recognizes Councilor Edwards sponsored Mayor disparity study pilot program laws 30 Section 18. disparity minority women contractors Boston six contracts groups government financial benefits Boston recommend pass colleagues vote seeks acceptance report passage Docket 1239 call roll? Docket 1239 Councilor Arroyo BakerCouncilor Flaherty Flynn Murphy O'Malley Madam President 1239 unanimous vote 1239 passed Madam Clerk read docket 0863 pest control illegal dumping Boston
Your summary:

151
(4x)
In the meeting, Madam Court discussed Docket 1239 regarding the Committee on Government Operations' referral of the sheltered market program laws Chapter 30 B Section 18. The program aimed to address disparities in contracts for goods and services, particularly benefiting disadvantaged minority and women vendors. Six contracts were discussed, highlighting the city's commitment to reducing disparities. Councilor Edwards sponsored a Mayor disparity study pilot program, seeking acceptance and passage of Docket 1239. The Council unanimously passed Docket 1239, and subsequently, Docket 0863 regarding pest control and illegal dumping in Boston was read.
Original Summarize the following meeting transcript (which may be compressed):
H adoption of resolution limiting natural gas infrastructure for new residential construction on city owned property. And we do have one speaker on this. Okay. Oh, well, we take our public speaker first. Public speaker. Come on it. Melissa, you. Hi councilmembers. My name is Melissa. You and I am with the Sierra Club. I'm here today to support this resolution, and I'm going to keep my comments short because hopefully you all have read our long support letter highlighting all the reasons why you all should support this. And so I'm excited to be here and I hope that this resolution passes unanimously, because if this passes, Alameda would actually be the 15th city in California to move forward towards being gas free and buildings. And I am also looking forward to seeing how the city continues to find ways to broaden the ordinance to consider not only city properties, but also properties not owned by the city. So thank you. Thank you. And that was the only public speaker. Okay, discussion or motion. I'll make a motion. I just want to. But I want to thank Assistant City Manager. Oh, you know what? Actually, this is one. I'm sorry to interrupt you, Vice Mayor, but this is one where. Go ahead. Yeah, well, no, because you remember that little city manager mentioned this at the beginning. There was a change. I think we even got an email there. Just for public. So they know exactly what you're making a motion on. We circulated. We want to just make a few small changes. So I don't want to talk about right now. Just quickly point out for you and the public the changes from what's before you then from what went out ten days ago and I'm sorry the one we just we we I met to get you the strike out version but the basic changes where we left we deleted a reference to San Bruno in the paragraph about gas infrastructure and earthquakes. That was not an earthquake issue. That was a construction issue. We eliminated a reference to the 14,000 tons that would be saved by this. Rizzo That was a miss. That was not correct. That's if we that's that's what would be saved by a larger effort citywide. And then we added, probably most importantly, an additional finding, which really deals with the fact that we are going to have a natural gas infrastructure with us for quite a while still. And we need to be thinking about the jobs and the people who work on that, that they we will still need them. And we need to think about how we convert those jobs over time to we will always need utility jobs. They may not be natural gas, it may be non-fossil fuel utilities. So I just wanted everybody to know what we changed since it went out in the packet. Thank you. Okay. Vaisman. I was just going to give my thanks to Assistant City Manager Bowden for his work on this and Andrew and his team. I know you guys move very fast in this and it was great to see it happen. So thank you very much. And with that, I'd like to move approval. Okay, we have a motion and then we have discussion. I just also want to say thank you. I mean, it's good to see that something in our climate action plan is is actually getting done. So I appreciate that a lot. Yeah. And and I hope some of you at least cut the the op ed that the mayor of Berkeley and I did about building electrification. That was in the Chronicle a couple of weeks ago. Okay. We have a motion. We have a second on favor. I opposed any abstain hearing and that motion passes unanimously. Thank you. All right. It's 833 and we finished the consent calendar. So moving right along. Item six A public hearing to consider adoption of resolution amending the general plan business park classification to clarify the allowable floor area ratio at Harvard Bay Business Park as recommended by the City Planning Board.
Your summary:

820 The meeting began with a public speaker, Melissa from the Sierra Club, expressing support for a resolution limiting natural gas infrastructure for new residential construction on city-owned property. She highlighted the environmental benefits and hoped for unanimous support. The council then discussed minor changes to the resolution, including removing references to San Bruno and correcting data on emissions reduction. An additional finding was added to consider the transition of utility jobs away from natural gas. The council expressed gratitude for the work done and swiftly moved to approve the resolution. They acknowledged progress in their climate action plan and passed the motion unanimously. The meeting proceeded to discuss a public hearing on amending the general plan for a business park.
LLMLingua2
Summarize the following meeting transcript (which may be compressed):
adoption resolution limiting natural gas infrastructure new residential construction city property. one speaker. public speaker first. Melissa. Sierra Club. support resolution comments short support letter. excited hope resolution passes unanimously Alameda 15th city California gas free. looking forward city broaden ordinance consider city properties not city. thank you. only public speaker. discussion motion. Assistant City Manager.?. manager change. email. public. motion few small changes. changes deleted reference San Bruno gas infrastructure earthquakes. not earthquake. construction issue. eliminated reference 14,000 tons saved. larger effort citywide.added additional finding natural gas infrastructure. jobs. convert jobs utility jobs. not natural gas non-fossil fuel utilities. changed packet. thanks Assistant City Manager Bowden Andrew team. fast approval. motion discussion. climate action plan done. op mayor Berkeley building electrification. Chronicle motion. second favor. passes unanimously. finished consent calendar. Item six public hearing resolution amending general plan business park classification allowable floor area ratio Harvard Bay Business Park City Planning Board.
Your summary:

204
(4x)
The meeting discussed a resolution to limit natural gas infrastructure in new residential construction on city property. Melissa from the Sierra Club expressed support for the resolution, hoping for unanimous approval. The Assistant City Manager presented a motion with minor changes, including the removal of references to earthquakes and specific tonnage saved, and the addition of findings regarding job conversion to non-fossil fuel utilities. The motion was quickly approved, with unanimous support, after mentioning progress on the climate action plan and Berkeley's building electrification efforts. Following this, they moved on to a public hearing regarding a resolution amending the general plan for a business park.

πŸ•ΈοΈ Retrieval-Augmented Generation (RAG) - Multi-Documnent Question-Answer

To test a realistic retrieval-augmented generation setup that closely resembles commercial search and question-answering applications (e.g., Bing Chat), we choose NaturalQuestions for evaluation. We first use the coarse-grained compression of LongLLMLingua to recall several relevant documents from a candidate set, and then form the corresponding prompts. This approach allows us to assess the performance of our models in a more practical setting and measure their effectiveness in handling real-world search and question-answering tasks. The response generated by GPT-3.5-Turbo.


Original
(NaturalQuestions)
Write a high-quality answer for the given question using only the provided search results (some of which might be irrelevant).

......
Document [2](Title: OPEC) of "the top 100 most influential people in the shipping industry". However, the influence of OPEC on international trade is periodically challenged by the expansion of non-OPEC energy sources, and by the recurring temptation for individual OPEC countries to exceed production targets and pursue conflicting self-interests. As of June 2018, OPEC has 15 member countries: six in the Middle East (Western Asia), seven in Africa, and two in South America. According to the U.S. Energy Information Administration (EIA), OPEC\'s combined rate of oil production (including gas condensate) represented 44 percent of the world\'s total in 2016, and OPEC accounted for
......
Document [10](Title: OPEC) Organization of the Petroleum Exporting Countries (OPEC, /ˈoʊpΙ›k/ OH-pek, or OPEP in several other languages) is an intergovernmental organization of 14 nations as of February 2018, founded in 1960 in Baghdad by the first five members (Iran, Iraq, Kuwait, Saudi Arabia, and Venezuela), and headquartered since 1965 in Vienna, Austria. As of 2016, the 14 countries accounted for an estimated 44 percent of global oil production and 73 percent of the world\'s "proven" oil reserves, giving OPEC a major influence on global oil prices that were previously determined by American-dominated multinational oil companies.
......

Question: how many countries are a part of opec in may 2018
Answer:
2,946 15 54.1
LLMLingua-2 Write a high-quality answer for the given question using only the provided search results (some of which might be irrelevant).

Document [7](Title OPEC member countries ensure stabilization oil markets secure efficient economic regular supply petroleum consumers steady income producers fair return capital investing petroleum industry. ......
......
Document [10](Title OPEC Organization Petroleum Exporting intergovernmental organization 14 nations February 2018 founded 1960 Baghdad five members (Iran Iraq Kuwait Saudi Arabia headquartered since 1965 Vienna Austria 2016, 14 countries 44 percent global oil production 73 percent world's oil reserves influence global oil prices American multinational oil companies.
OPEC members Libya Nigeria covered first half 2017 promised reductions Russia non-members offset increases US shale sector Libya Nigeria spare capacity surging late-2016 OPEC production cuts Indonesia suspension OPEC membership 5 percent production cut Prices fluctuated US$50/bbl OPEC May 2017 quotas through March 2018 oil inventory glut.
......

Question: how many countries are a part of opec in may 2018
Answer:
605
(5x)
14 74.0
(+19.9)
Original
(NaturalQuestions)
Write a high-quality answer for the given question using only the provided search results (some of which might be irrelevant).

Document [1](Title: In the Heat of the Night (TV series)) ex-partner and Althea's ex-lover (Michael Warren from \"Hill Street Blues\") coming to visit for a reunion that no one would ever forget; Chief Gillespie's having to face his own bigoted past when he arrests a close friend (played by Ed Ames) (who is also the sheriff of the neighboring county) for committing a racially motivated murder; Bubba's getting caught up in a murderous love triangle; Althea's niece \"Nicole\" visiting, and with new friend \"Bobby Skinner\" (Bubba's nephew) stumbling upon criminal malfeasance in the episode \"City Mouse Country Mouse\". Mary Crosby and Judith Chapman stir up trouble when the sisters are
......
Document [10](Title: Alan Autry) Carlos Alan Autry Jr. (also known for a period of time as Carlos Brown; born July 31, 1952), is an American actor, politician, and former National Football League player. During his brief football career, he was known as Carlos Brown. He played the role of Captain Bubba Skinner on the NBC television series, In the Heat of the Night, starring Carroll O'Connor. He has also appeared in films and other television shows. In November 2000, he was elected mayor of Fresno, California, and served for two four-year terms through January 2009. In 2008, Autry was hosting a radio news talk.
......
"Document [13](Title: Carroll O'Connor) on CBS in that show's last three seasons. While coping with his son's drug problem, O'Connor starred as Sparta, Mississippi, Police Chief Bill Gillespie, a tough veteran cop on \"In the Heat of the Night\". Based on the 1967 movie of the same name, the series debuted on NBC in March 1988 and performed well. He cast his son Hugh O'Connor as Officer Lonnie Jamison. The headquarters of the Sparta Police Department was actually the library in Covington, Georgia. Much like O'Connor himself, Gillespie was racially progressive and politically liberal, but the character of Bill Gillespie was also a smart",

Question: "who played bubba in the heat of the night?"
Answer:
2628 "Alan Autry" In this example, the answer can be found in the first sentence of document 10. 54.1
LLMLingua-2 Write a high-quality answer for the given question using only the provided search results (some of which might be irrelevant).

Document [2](Title: In Heat of the Night (TV series) real father. end episode Lana finds Bill is her real father him his nonexistence her for 20 years. hurts Bill hard time dealing. story lines include taxidermist obsessed with schoolteacher game high-stakes poker ends in murder Bubba's Sheriff McComb's deputy growing pot Sweet's truth about murder of grandfather in 1948 story
......
Carlos Alan Autry Jr. known as Carlos Brown born July 31, 1952), American actor, politician former National Football League player. brief football career known as Carlos Brown. role Captain Bubba Skinner NBC series In Heat of the Night starring Carroll O'Connor. appeared films television shows. November 2000, elected mayor Fresno California served two four-year terms January 2009. 2008, radio news talk
......
Carroll O'Connor CBS three seasons son Sparta Mississippi Police Chief Bill Gillespie veteran cop Heat 1967 movie series NBC March 1988 son Hugh O'Connor Officer Lonnie Jamison Sparta Police Department library Covington Georgia Gillespie progressive liberal

Question: "who played bubba in the heat of the night?"
Answer:
526
(5x)
Carlos Alan Autry Jr. known as Carlos Brown played Bubba Skinner in the In Heat of the Night TV series. [10] 74.0
(+19.9)

πŸ’‘ In-Context Learning, Chain-of-Thought, Reasoning

LLMs are known for their outstanding Chain-of-Thought and reasoning abilities. To evaluate the preservation of such capabilities in compressed prompts, we conducted tests on GSM8K using complex 9-steps Chain-of-Thought prompts as the original prompts. The results show that a similar performance can be maintained at a compression ratio of up to 14x.


Method Prompt Tokens Response Accuracy
Original Please reference the following examples to answer the math question,

Question: Sam bought a dozen boxes, each with 30 highlighter pens inside, for $10 each box. He rearranged five of these boxes into packages of six highlighters each and sold them for $3 per package. He sold the rest of the highlighters separately at the rate of three pens for $2. How much profit did he make in total, in dollars?
Let's think step by step
Sam bought 12 boxes x $10 = $120 worth of highlighters.
He bought 12 * 30 = 360 highlighters in total.
Sam then took 5 boxes Γ— 6 highlighters/box = 30 highlighters.
He sold these boxes for 5 * $3 = $15
After selling these 5 boxes there were 360 - 30 = 330 highlighters remaining.
These form 330 / 3 = 110 groups of three pens.
He sold each of these groups for $2 each, so made 110 * 2 = $220 from them.
In total, then, he earned $220 + $15 = $235.
Since his original cost was $120, he earned $235 - $120 = $115 in profit.
The answer is 115

Question: A group of 4 fruit baskets contains 9 apples, 15 oranges, and 14 bananas in the first three baskets and 2 less of each fruit in the fourth basket. How many fruits are there?
Let's think step by step
......
The answer is 146

......
Question: Josh decides to try flipping a house. He buys a house for $80,000 and then puts in $50,000 in repairs. This increased the value of the house by 150%. How much profit did he make?
2,366 Let's think step by step:

Josh bought the house for $80,000.

He invested an additional $50,000 in repairs.

After the repairs, the value of the house increased by 150%. To calculate the new value, you need to add 150% of the original value to the original value:

New Value = Original Value + (150% of Original Value)
New Value = $80,000 + (1.5 * $80,000)
New Value = $80,000 + $120,000
New Value = $200,000

To calculate the profit, subtract the total cost (purchase price + repair costs) from the new value:

Profit = New Value - Total Cost
Profit = $200,000 - ($80,000 + $50,000)
Profit = $200,000 - $130,000
Profit = $70,000

Josh made a profit of $70,000 from flipping the house.
78.85
LLMLingua2 Please reference the following examples to answer the math question,

Question: Sam bought dozen boxes each with 30 highlighter pens for $10 each rearranged five boxes into packages six highlighters sold for $3 per package sold rest highlighters three pens for $2. profit total dollars?
step by step
Sam bought 12 boxes x $10 = $120 highlighters
12 * 30 = 360 highlighters total
took 5 boxes Γ— 6 highlighters/box = 30 highlighters
sold boxes for 5 * $3 = $15
After 5 360 - 30 = 330 highlighters remaining
330 / 3 = 110 groups of three pens
sold each groups for $2 each made 110 * 2 = $220
earned $220 + $15 = $235.
original cost $120 earned $235 - $120 = $115 profit
The answer is 115

Question: Josh decides to try flipping a house. He buys a house for $80,000 and then puts in $50,000 in repairs. This increased the value of the house by 150%. How much profit did he make?
178
(14x)
Let's think step by step
The repairs increased the value by 80,000*1.5=$<<80000*1.5=120000>>120,000
So the house is now worth 80,000+120,000=$<<80000+120000=200000>>200,000
So his profit was 200,000-80,000-50,000=$<<200000-80000-50000=70000>>70,000. Answer: 70,000.
77.79

BibTeX

If you find this repo helpful, please cite the following papers:

@inproceedings{pan-etal-2024-llmlingua,
    title = "{LLML}ingua-2: Data Distillation for Efficient and Faithful Task-Agnostic Prompt Compression",
    author = "Zhuoshi Pan and Qianhui Wu and Huiqiang Jiang and Menglin Xia and Xufang Luo and Jue Zhang and Qingwei Lin and Victor Ruhle and Yuqing Yang and Chin-Yew Lin and H. Vicky Zhao and Lili Qiu and Dongmei Zhang",
    editor = "Ku, Lun-Wei  and
        Martins, Andre  and
        Srikumar, Vivek",
    booktitle = "Findings of the Association for Computational Linguistics ACL 2024",
    month = aug,
    year = "2024",
    address = "Bangkok, Thailand and virtual meeting",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2024.findings-acl.57",
    pages = "963--981",
}