274 Matching Annotations
  1. May 2025
    1. wasting compute on semantically empty tokens.Unpadding avoids this inefficiency by removingpadding tokens, concatenating all sequencesfrom a minibatch into a single sequence, andprocessing it as a batch of one. Prior unpaddingimplementations unpad and repad sequencesinternally for different model layers, wastingcompute and memory bandwidth. We use FlashAttention’s variable length attention and RoPEimplementations, allowing jagged attention masksand RoPE applications on one unpadded sequence.ModernBERT unpads inputs before the tokenembedding layer and optionally repads modeloutputs leading to a 10-to-20 percent performanceimprovement over other unpadding methods.

      Unpadding: Mô hình ModernBERT đi theo phương pháp của mô hình MosaicBERT và GTE trong việc triển khai unpadding cho cả huấn luyện và infer. Các mô hình encoder thường thêm token pad để đồng bộ chiều dài của các đầu vào, dẫn đến việc lãng phí tài nguyên để tính các token rỗng. Việc unpadding tránh được việc này bằng cách loại bỏ các token này, nối các chuỗi trong 1 batch thành 1 chuỗi duy nhất, sau đó cho xử lý như với batch_size = 1. Các cài đặt unpadding ban đầu loại bỏ và thêm pad lại cho các chuỗi ở từng layer, dẫn đến lãng phí thông lượng. Flash attention với độ dài có thể biến đổi và RoPE được sử dụng. cho phép attention mask có răng cưa và RoPE cho 1 chuỗi unpad đơn lẻ. ModernBERT unpad các đầu vào trước khi cho vào lớp embedding và có thể repad sau khi nhận được đầu ra

    2. Alternating Attention Following recent work onefficient long context models (Gemma et al., 2024),attention layers in ModernBERT alternate betweenglobal attention, where every token within a se-quence attends to every other token, and local atten-tion, where tokens only attend to each other withina small sliding window (Beltagy et al., 2020). InModernBERT, every third layer employs globalattention with a RoPE theta of 160,000 and theremaining layers use a 128 token, local sliding win-dow attention with a RoPE theta of 10,000

      các lớp attention của ModernBERT được thay thế giữa attention toàn cục, nơi mọi token trong chuỗi đều chú ý đến toàn bộ các token còn lại và attention cục bộ, trong đó các token chỉ quan tâm đến một số token lân cận trong phạm vi cửa sổ trượt. Trong mô hình modernBERT, mọi lớp thứ ba đều sử dụng attention toàn cụ với RoPE theta bằng 160.000 và các lớp khác sử dụng attention cục bộ với cửa số trượt bằng 128 và RoPE theta bằng 10000

    3. Bias Terms Following (Dayma et al., 2021), wedisable bias terms in all linear layers except for the1FlexBERT is built on top of a revised Mo-saicBERT (Portes et al., 2023) codebase.final decoder linear layer2. We also disable all biasterms in Layer Norms (Xu et al., 2019). These twochanges allow us to spend more of our parameterbudget in linear layers

      bỏ qua bias ở tất cả các lớp tuyến tính, trừ lớp tuyến tính ở lớp decoder cuối cùng. Bias ở tất cả các lớp norm cũng bị loại bỏ, cho phép dành không gian cho các trọng số khác.

    4. Positional Embeddings We use rotary posi-tional embeddings (RoPE) (Su et al., 2024) insteadof absolute positional embeddings. This choice ismotivated by the proven performance of RoPE inshort- and long-context language models (Blacket al., 2022; Dubey et al., 2024; Gemma et al.,2024), efficient implementations in most frame-works, and ease of context extension

      embedding vị trí: sử dụng RoPE, đã được chứng minh hiệu quả với các mô hình ngữ cảnh ngắn và dài.

    5. Activation We adopt GeGLU (Shazeer, 2020),a Gated-Linear Units (GLU)-based (Dauphin et al.,2017) activation function built on top of the origi-nal BERT’s GeLU (Hendrycks and Gimpel, 2016)activation function. This is in line with recent workshowing consistent empirical improvements whenusing GLU variants (Shazeer, 2020; Geiping andGoldstein, 2023).

      Hàm activation: sử dụng hàm GeGLU bên trên hàm GeLU

  2. Apr 2025
    1. sub-optimal documentsin terms of scope and diversity, large-scale websearches (Piktus et al., 2021; Komeili et al., 2022)are integrated as a strategic extension of RAG.Specifically, the inputs are rewritten into queriescomposed of keywords by ChatGPT to mimic thedaily usage of search engine. The prompt forrewriting is shown in Appendix A. In CRAG,a public and accessible commercial web searchAPI is adopted to generate a series of URL linksfor every query. 3 Considering that knowledgefrom large-scale web searches could introducebiases or unreliable information, authoritative andregulated web pages like Wikipedia are preferred,which can significantly help mitigate these issues.Moreover, we utilize the URL links to navigateweb pages, transcribe their content, and employ thesame knowledge refinement method as Section 4.4to derive the relevant web knowledge, namelyexternal knowledge.

      công cụ web search trên quy mô lớn được tích hợp vào RAG. Cụ thể, các đầu vào sẽ được viết lại thành các truy vấn, được cấu thành từ những từ khóa được đề xuất bởi ChatGPT. Trong CRAG, một APi web search phổ biến sẽ được sử dụng để tạo ra 1 loại các đường dẫn cho mọi truy vấn. Với đánh giá rằng kiến thức từ web search thường bị thiên lệch hoặc không tin cậy, các trang web tốt như wiki sẽ được ưu tiên. Hơn nữa, các đường dẫn URL được tổng hợp để dẫn đến trang web, sau đó nội dung của các trang sẽ được trích xuất và sẽ đi qua quá trình chắt lọc như ở phần 4.4.

    2. Therefore, it is extremely importantto seek complementary external knowledge ifthe retrieved results are all assumed irrelevant,and we consider a system that knows what itdoesn’t know and what it cannot answer to bemore intelligent than one that clings to limitedknowledge and is incapable of seeking externalknowledge

      Việc có thể tìm kiếm các kiến thức bên ngoài là rất quan trọng trong trường hợp các kết quả truy xuất đều được cho là không liên quan, và một hệ thống sẽ được cho là thông minh hơn nếu nó biết nó không biết gì và không thể trả lời được gì.

    3. 4.4 Knowledge RefinementGiven a retrieved relevant document, a decompose-then-recompose knowledge refinement methodis designed to further extract the most criticalknowledge strips in it. To obtain fine-grainedretrieval results, we segmented the retrieved resultsinto internal strips. If a retrieved result is as short asone or two sentences, it is regarded as an individualstrip, otherwise, retrieval documents are required tobe split into smaller units which generally consistof a few sentences according to the total length.The scale is assumed to include an independentpiece of information, and the filtering is based onthe segments. Then, the retrieval evaluator fine-tuned in Section 4.2 is employed to calculate therelevance score of each knowledge strip. Basedon these scores, irrelevant knowledge strips arefiltered out, while relevant ones are recomposed viaconcatenation in order, namely internal knowledge

      Chắt lọc kiến thức: Cho một tài liệu được truy xuất, một phương pháp chắt loặc dữ liệu phân rã-kết hợp được thiết kế để có thể trích xuất các đoạn kiến thức quan trọng nhất. Trước hết, các tài liệu truy xuất được phân mảnh thành các đoạn nhỏ. Với các tài liệu ngắn khoảng 1-2 câu thì sẽ không bị phân mảnh. Mỗi đoạn sẽ được coi như chứa một đoạn thông tin độc lập, và việc lọc sẽ được thực hiện dựa trên các đoạn phân mảnh. Sau đó, mô hình đánh giá sẽ tính điểm liên quan của mỗi đoạn kiến thức. Các đoạn được cho là liên quan sẽ nối lại với nhau, tạo thành tài liệu hoàn chỉnh

    4. Incorrect Besides, a retrieval is assumedIncorrect when the confidence scores of allretrieved documents are below the lower threshold.This indicates that all retrieved documents areconsidered irrelevant, which are unhelpful forgeneration. Once the knowledge from the retrievalresults is judged to be inaccurate, it is unwise tostill get stuck in it, which is likely to result infabricated facts. Therefore, we need to seek newsources of knowledge for correction. Here, websearch is introduced to search from the Internet aselaborated in Section 4.5. This corrective actionhelps overcome the embarrassing challenge whereno reliable knowledge can be referred to.

      Một truy xuất bị coi là Incorrect khi điểm confidence của tất cả các tài liệu truy xuất đều bị coi là Incorrect. Trong trường hợp này, web search được áp dụng để tìm kiếm từ Internet. Hành động sửa lỗi này sẽ giúp vượt qua thách thức khi không có nguồn kiến thức tin cậy nào được truy xuất.

    5. Correct Here, a retrieval is assumed Correctwhen the confidence score of at least one retrieveddocument is higher than the upper threshold. Ifso, it means that there are relevant documents inthe retrieved results, and the knowledge from theretrieval results is supposed to be more reliable andaccurate. However, even if a relevant document canbe found, there is inevitably some noisy knowledgestrips in this document. To extract the mostcritical knowledge strips within this document, aknowledge refinement method is further designedwhich will be elaborated in Section 4.4.

      Một truy xuất được coi là Correct khi có ít nhất một tài liệu truy xuất trong đó được xác định là Correct.Khi được xác định là correct, các tài liệu sẽ tiếp tục được cho vào 1 thuật toán để trích xuất ra các đoạn kiến thức quan trọng nhất

    6. Based on the aforementionedconfidence score for each retrieved document, threetypes of actions are designed and triggered accord-ingly where the upper and lower thresholds are set.If the confidence score is higher than the upperthreshold, the retrieved document is identified asCorrect, while identified as Incorrect if belowthe lower threshold. Otherwise, a more soft andintermediate action, i.e., Ambiguous is executed.Each retrieved document is conducted individuallyand integrated eventually.

      Dựa trên điểm confidence được đề cập ở phần trên, 3 loại hành động sẽ được thiết kế và kích hoạt dựa trên cận trên và cận dưới của điểm.

      Nếu điểm confidence cao hơn cận trên, tài liệu sẽ được coi là Correct, ngược lại nếu thấp hơn cận dưới sẽ bị coi là Incorrect. Nếu nằm giữa 2 cận sẽ được xác định là Ambiguous.

    7. he relevance signalsfor fine-tuning the evaluator can be collected fromthe existing datasets. For example, PopQA (Mallenet al., 2023) provides the golden subject wiki titlefrom wikipedia for each question. We can use thatto track a not 100% relevant but rather high-qualitypassage. We utilized that as the relevance signalsfor fine-tuning the retrieval evaluator.2 On the otherhand, the negative samples for fine-tuning wereall randomly sampled from the retrieval results,which are rather similar to the input query but2https://huggingface.co/datasets/akariasai/PopQAnot relevant. More details about this fine-tuningstep can be referred to in Appendix B.3. Forevery question, there are generally 10 documentsretrieved. The question is concatenated with eachsingle document as the input, and the evaluatorpredicts the relevance score for each question-document pair individually. We also tried to promptChatGPT to identify the retrieval relevance forcomparison, but it underperforms as elaborated inSection 5.5. Based on these calculated relevancescores, a final judgment is made as to whetherthe retrieval is correct or not associated with theaction trigger. In our proposed framework, theretrieval quality is evaluated at a relatively lowcost without the need to have access to large andexpensive LLMs. Compared with the critic modelof Self-RAG (Asai et al., 2024) that instruction-tuned LLaMA-2 (7B), the evaluator designed inCRAG demonstrates the advantages of being quitelightweight (0.77B).

      Tín hiệu liên quan được sử dụng để fine-tune mô hình đánh giá có thể được thu thập từ các bộ dataset hiện có. Bộ dữ liệu popQA, bao gồm các tiêu đề wiki được gán với câu hỏi, được sử dụng làm các tín hiệu liên quan để fine-tune mô hình đánh giá. Ngoài ra, các mẫu tiêu cực được sử dụng để fine-tune được chọn ngẫu nhiên từ các dữ liệu truy xuất, khá tương tự với truy vấn đầu vào nhưng không liên quan

      Với mỗi câu hỏi, có khoảng 10 tài liệu truy xuất. Câu hỏi được nối với mỗi tài liệu đơn lẻ, tạo thành đầu vào, và mô hình đánh giá sẽ dự đoán điểm liên quan của mỗi cặp câu hỏi-tài liệu.

      ChatGPT đã được thử nghiệm để làm việc này nhưng đã thể hiện không tốt.

      Dựa trên điểm liên quan, quyết định cuối cùng được đưa ra xem liệu việc truy xuất có đính hay không liên quan.

    8. To ensure all experimental results werecomparable with Self-RAG (Asai et al., 2024), thesame retrieval results through Contriever (Izacardet al., 2022) provided by Self-RAG were alsoadopted in our experiments

      Để đảm bảo rằng mọi kết quả thử nghiệm đều có thể so sánh với Self-RAG, các kết quả truy xuất tương tự thông qua Contriever, được cung cấp bởi self-RAG cung có thể được áp dụng vào quá trình thực nghiệm.

    9. Specifically, T5-large (Raffelet al., 2020) is adopted for initializing the retrievalevaluator and fine-tuned

      T5-large được sử dụng để khởi tạo mô hình đánh giá và fine-tune

    10. Our objective is to correct the retrieved documentsif they are irrelevant

      Nhiệm vụ: chỉnh sửa các dữ liệu không liên quan cho đúng.

    11. Figure 2 and Algorithm 1 present an overviewof CRAG at inference, which designs correctivestrategies to improve the robustness of generation.Given an input query and the retrieved documentsfrom any retriever, a lightweight retrieval evaluatoris constructed to estimate the relevance scoreof retrieved documents to the input query (Sec-tion 4.2). The relevance score is quantified into atotal of three confidence degrees and then triggeredthe corresponding actions: {Correct, Incorrect,Ambiguous} (Section 4.3). If the action Correctis triggered, the retrieved documents will be re-fined into more precise knowledge strips. Thisrefinement operation involves knowledge decom-position, filter, and recomposition (Section 4.4).If the action Incorrect is triggered, the retrieveddocuments will be discarded. Instead, web searchesare resorted to and regarded as complementaryknowledge sources for corrections (Section 4.5).Eventually, when it cannot confidently make acorrect or incorrect judgment, a soft and balancedaction Ambiguous which combines both of them istriggered. After optimizing the retrieval results, anarbitrary generative model can be adopted

      Kiến trúc tổng quan của CRAG: - Với 1 truy vấn đầu vào, một mô hình đánh giá truy xuất sẽ được xây dựng để tính điểm liên quan của tài liệu được truy xuất đối với truy vấn. Điểm này được lượng hóa thành tổng của 3 điểm confidence và sau đó kích hoạt 3 hành động sau {Correct, Incorrect, Ambiguous}. - Khi được xác định là Correct, tài liệu truy xuất sẽ được tinh gọn thành các mảng kiến thức chính xác.Việc tinh gọn này bao gồm quá trình phần rã kiến thức, lọc, và kết hợp kiến thức - Nếu được xác định là Incorrect, tài liệu truy xuất sẽ bị loại bỏ và được thay bởi dữ liệu được truy xuất bởi web search - Nếu được xác định là Ambiguous, sẽ áp dụng các phương pháp của cả 2 phương pháp trên.

    12. Besides, a decompose-then-recompose algorithm is designed for retrieveddocuments to selectively focus on key infor-mation and filter out irrelevant information inthem

      Một thuật toán phân rã và tái hợp được thiết kế cho các tài liệu được truy xuất để có thể chú ý một cách chọn lọc các thông tin chính và loại bỏ thông tin không liên quan

    13. Specifically, a lightweightretrieval evaluator is designed to assess theoverall quality of retrieved documents for aquery, returning a confidence degree basedon which different knowledge retrieval ac-tions can be triggered.

      Sử dụng CRAG: một mô hình đánh giá được thiết kế để đánh giá chất lượng tổng thể của các tài liệu được truy xuất đối với một truy vấn, đưa ra điểm confidence dựa trên việc các hành động truy xuất tri thức nào nào có thể được kích hoạt.

    14. Since retrieval fromstatic and limited corpora can only return sub-optimal documents, large-scale web searchesare utilized as an extension for augmenting theretrieval results.

      tìm kiếm web với quy mô lớn được tích hợp vào để mở rộng và tăng cường cho các kết quả được truy xuất do việc truy xuất là cố định và bộ ngữ liệu chỉ có thể truy xuất ra các ngữ liệu không tối ưu

    15. Al-though retrieval-augmented generation (RAG)is a practicable complement to LLMs, it reliesheavily on the relevance of retrieved docu-ments, raising concerns about how the modelbehaves if retrieval goes wrong

      Vấn đề hiện tại của RAG: phụ thuộc lớn vào độ liên quan của các tài liệu được truy vấn, gợi lên vấn đề về việc mô hình sẽ xử lý như thế nào khi việc truy vấn không tốt.

    1. he training of M3-Embedding poses a signifi-cant challenge. In our work, the following technicalcontributions are made to optimize the embeddingquality. Firstly, we propose a novel self knowl-edge distillation framework, where the multipleretrieval functionalities can be jointly learned andmutually reinforced. In M3-Embedding, the [CLS]embedding is used for dense retrieval, while embed-dings from other tokens are used for sparse retrievaland multi-vector retrieval. Based on the principleof ensemble learning (B ̈uhlmann, 2012), such het-erogenous predictors can be combined as a strongerpredictor. Thus, we integrate the relevance scoresfrom different retrieval functions as the teachersignal, which is used to enhance the learning pro-cess via knowledge distillation. Secondly, we op-timize the batching strategy to achieve a largebatch size and high training throughput, which sub-stantially contributes to the discriminativeness ofembeddings. Last but not least, we perform exten-sive and high-quality data curation. Our datasetincludes three sources: 1) the extraction of unsuper-vised data from massive multi-lingual corpora, 2)the integration of closely related supervised data, 3)the synthesization of scarce training data. The threedata sources are complement to each other and ap-plied to different training stages, which lays a solidfoundation for the versatile text embeddings.

      Qúa trình huấn luyện bao gồm: - self knowledge distillation: các chức năng truy xuất có thể được học một cách đan xen và tăng cường cho nhau.Trong hàm M3, embedding của token [CLS] được sử dụng làm truy xuất cô đặc, trong khi embedding của các token khác được sử dụng làm truy xuất rời rạc và truy xuất đa vector. Điểm liên quan của các hàm truy xuất khác nhau sẽ được tich hợp, tạo thành tính hiệu học, được sử dụng để nâng cao quá trình học thông qua chắt lọc kiến thức. - Tối ưu chiến thuật batch: nhằm đạt được 1 batch size lớn và thống lượng huấn luyện cao, đóng góp lớn cho khả năng phân biệt của các vector embedding. - Trắt lọc data toàn diện và chất lượng cao: Data đến từ 3 nguồn: (1) Trích xuất từ data không giám sát từ các bộ ngữ liệu đa ngôn ngữ. (2) các dữ liệu có quan hệ gần gũi với dữ liệu giám sát. (3) Tổng hợp từ dữ liệu huấn luyện rời rạc.

    2. espite the widespread popularity of text em-beddings, the existing methods are still limited inversatility. First of all, most of the embedding mod-els are tailored only for English, leaving few viableoptions for the other languages. Secondly, the exist-ing embedding models are usually trained for onesingle retrieval functionality. However, typical IRsystems call for the compound workflow of multi-ple retrieval methods. Thirdly, it is challenging totrain a competitive long-document retriever due tothe overwhelming training cost, where most of theembedding models can only support short inputs.

      Một vài hạn chế về tính linh hoạt: - Chỉ được định hướng cho tiếng Anh, không khả thi cho các ngôn ngữ khác. - các mô hình embedding hiện nay chỉ thường chỉ được huấn luyện cho 1 chức năng truy xuất. Tuy nhiên, các hệ thông IR hiện nay thường gọi đến các workflow phức hợp với nhiều phương pháp truy xuất khác nhau. - Việc huấn luyện một mô hình truy xuất văn bản dài là rất thử thách do chi phí huấn luyện cao

    3. One com-mon form of embedding-based IR application is†. Co-first author∗. Corresponding authors1. The model, code, and data is publicly available athttps://github.com/FlagOpen/FlagEmbedding.BGE M3-EmbeddingMulti-LingualCross-Lingual100+ LanguagesSparse RetrievalMulti-Vec RetrievalDense RetrievalPassage-LevelDoc-Level (≤8192)Sentence-LevelMulti-Linguality Multi-Functionality Multi-GranularityM3-EmbeddingMulti-LingualCross-Lingual100+ LanguagesSparse RetrievalMulti-Vec RetrievalDense RetrievalPassage-LevelDoc-Level (≤8192)Sentence-LevelMulti-Linguality Multi-Functionality Multi-GranularityFigure 1: Characters of M3-Embedding.dense retrieval, where relevant answers to the querycan be retrieved based on the embedding similarity(Karpukhin et al., 2020; Xiong et al., 2020; Nee-lakantan et al., 2022; Wang et al., 2022; Xiao et al.,2023). Besides, the embedding model can also beapplied to other IR tasks, such as multi-vector re-trieval where the fine-grained relevance betweenquery and document is computed based on the in-teraction score of multiple embeddings (Khattaband Zaharia, 2020), and sparse or lexical retrievalwhere the importance of each term is estimated byits output embedding (Gao et al., 2021a; Lin andMa, 2021; Dai and Callan, 2020)

      Một dạng ám dụng IR phổ biển được sử dụng hiện nay là truy xuất cô đặc (dense retrieval). Bên cạnh đó, mô hình embedding cũng có thể được áp dụng cho các task IR khác, như truy xuất da vector (multi-vector) mà trong đó, độ liên quan giữa tài liệu và truy vấn được tính dựa trên tương tác của nhiều vector embedding

  3. Feb 2025
    1. ArmoRM. Wang et al. (2024b) argue that cur-rent reward models often conflate different objec-tives, making it difficult to discern which aspectsof the input data influence their scoring. To ad-dress this, they proposed the ArmoRM (AbsoluteRating Multi-Objective Reward Model). As illus-trated in Figure 14, the model processes a contextand multiple candidate responses, evaluating themacross interpretable dimensions such as honesty,safety, verbosity, and relevance. Each dimensionis assessed by a dedicated sub-model that gener-ates individual scores. These scores are then dy-namically weighted by a gating network, whichadapts to the context and produces a final rewardscore used as feedback for reinforcement learn-ing. This mixture-of-experts approach effectivelyseparates the objectives, allowing the scores to bemore clearly attributed to specific input featuresor goals, thus improving both interpretability andtransparency

      ArmoRM: chỉ ra rằng các reward model hiện tại thường kết hợp nhiều mục tiêu vào với nhau, khiến cho việc nhận biết các yếu tố ảnh hưởng đến điểm số trở nên khó khăn hơn. Đề xuất mô hình ArmoRM. Mô hình sẽ xử lý 1 ngữ cảnh và nhiều phản hồi ứng viên, đánh giá ở nhiều lĩnh vực có thể suy luận được như tính trung thực, tính an toàn, tính dài dòng và tính liên quan. Sau đó, các điểm này sẽ được gán trọng số 1 cách linh động và đạo thành điểm reward cuối cùng làm phản hồi cho quá trình học tăng cường.

    2. Out-of-distribution (OOD) issues present a signif-icant challenge in reward modeling, particularlywhen the reward model and the large languagemodel (LLM) are trained independently. This sep-aration can lead to inconsistencies in the knowl-edge and decision-making frameworks of the twomodels, potentially causing the reward model toencounter unfamiliar scenarios or fail to generalizeeffectively. Addressing OOD challenges is criticalfor ensuring that reward models (RMs) performreliably across diverse inputs

      OOD là vấn đề lớn đối với reward modeling. cụ thể là khi reward model và LLM được huấn luyện độc lập với nhau. Sự độc lập này có thể dẫn đến việc ko đồng nhất trong khung kiến thức và ra quyết định của 2 mô hình, từ đó có thể gây ra việc reward model sẽ gặp phải các ngữ cảnh không quen thuộc hoặc không thể tổng quát hóa một cách hiệu quả.

    3. These include addressing out-of-distribution issuesbetween the trained reward models and the alignedLLMs, ensuring the interpretability of the modelfor humans, and maintaining safety and evaluationbenchmarks to train robust reward models. In thissection, we discuss recent works that tackle thesechallenges and provide strategies for overcomingthem

      Một số thách thức của RLHF và RLAIF: - Các vấn đề liên quan đến OOD (out-of-distribution) giữa reward model đã qua huấn luyện và LLM - Đảm bảo tính có thể suy luận của mô hình đối với con người - Duy trì sự an toàn và benchmark đánh giá

    4. Magpie. Xu et al. (2024b) introduce a self-synthesis method that leverages the autoregressivenature of aligned LLMs. By utilizing predefinedtemplates as prompts, the model autonomously gen-erates user queries and corresponding responses,eliminating the need for manual intervention orinitial seed questions. Specifically, as shown in Fig-ure 4, aligned LLMs (e.g., Llama-3-Instruct model)is employed to synthesize 4 million instruction-response pairs, subsequently filtering the dataset toretain 300,000 high-quality pairs. These pairs werethen used to fine-tune the Llama-3-8B-Base model.Remarkably, the fine-tuned model achieved per-formance comparable to the official Llama-3-8B-Instruct model, which had undergone training on10 million examples through supervised fine-tuningand reinforcement learning with human feedback.Besides, models fine-tuned with Magpie excelledon alignment benchmarks such as AlpacaEval, sur-passing models trained on other open datasets andpreference optimization methods.

      Magpie giới thiệu 1 phương pháp tự tổng hợp, tận dụng khả năng sinh của LLM.

    5. RLHF that leverages AI systems—often more pow-erful or specialized LLMs (e.g., GPT-4 (OpenAI,2024a))—to provide feedback on the outputs ofthe LLM being trained. This approach providesbenefits such as scalability, consistency, and costefficiency while minimizing reliance on humanevaluators. Below, we explore several methodsfor substituting human feedback with AI feedbackin reinforcement learning, highlighting approaches:(1) Distilling AI Feedback to Train Reward Model,(2) Prompting LLMs As a Reward Function, and(3) Self-Rewarding.

      RLAIF tận dụng các hê thống AI (thường là các LLM mạnh mẽ hơn hoặc chuyên biệt hơn) để cung cấp các phản hồi đồi với đầu ra của LLM được huấn luyện. 3 Hướng tiếp cận chính của RLAIF: - Chắt lọc (distill) các phản hồi từ AI để huấn luyện reward model. - Prompt LLMs như một hàm reward - Self-rewarding

    6. (1) Rewarding: In this step, the LLM generatesmultiple outputs in response to a given instruction.Each output is then passed through the trained re-ward model, which assigns a scalar score that ap-proximates human preferences.(2) Policy Optimization: In this step, the LLM isfine-tuned by adjusting its parameters to maximizethe predicted reward, using the Proximal Policy Op-timization (PPO) (Schulman et al., 2017) or TrustRegion Policy Optimization (TRPO) (Schulman,2015) algorithm.

      2 bước chính trong quá trình tối ưu sử dụng human feedback: - Gán phần thưởng: Ở bước này, LLM sẽ sinh nhiều đầu ra ứng với 1 đầu vào. Mỗi đầu ra sau đó được đưa vào reward model đã được huấn luyện. Mô hình này gán điểm cho đầu ra.

    7. TÜLU-V2-mix (Ivison et al., 2023). TÜLU-V2-mix is designed to enhance instruction-followingcapabilities in large language models, offering adiverse dataset that improves the model’s general-ization and execution abilities across multi-domaintasks. It covers a wide range of tasks, includingquestion answering, code generation, translation,and multi-turn conversations, with a strong em-phasis on multilingual adaptability and handlingcomplex real-world scenarios. Skywork-Reward,on the other hand, is designed to align models withhuman preferences using preference pairs, helpingmodels learn to generate user-preferred responses,such as fluent and coherent text. While TÜLU-V2-mix excels in generalization across a wide range oftasks, Skywork-Reward specializes in optimizinguser-centric outputs. Together, they address com-plementary goals for advancing language modelcapabilities

      Bộ dữ liệu bao phủ một loạt các bài toán, bao gồm QA, sinh code, dịch và hội thoại nhiều lượt, nhận mạnh vào khả năng thích ứng với nhiều ngôn ngữ. và xử lý các ngữ cảnh phức tạp trong thực tế.

    8. (1) Collecting Human Feedback to TrainReward Model, where human evaluators providefeedback on the LLM’s outputs by scoring or rank-ing responses based on factors such as quality andrelevance. This feedback is then used to train a re-ward model that predicts the quality of the outputsand serves as the reward function in the RL process;and (2) Preference Optimization Using HumanFeedback, where the trained reward model guidesthe optimization of the LLM’s outputs to maximizepredicted rewards, aligning the LLM’s behaviorwith human preferences. Below, we will illustratethese two components via recent research studies

      2 giai đoạn của RLHF: - Thu thập dữ liệu human feedback để huấn luyện reward model mà ở đó, con người sẽ cung cấp phản hồi đối với đầu ra của LLM bằng cách chấm điểm hoặc xếp hạng các phản hồi dựa trên các yếu tố như chất lượng hoặc tính liên quan. Các phản hồi này sau đó được sử dụng để huấn luyện một reward model

      • Tối ưu policy sử dụng phản hồi của con người: trong đó, reward model hướng dẫn quá trình tối ưu đầu ra của LLM để tối đa hóa giá trị của reward model,
    9. The post-training process for aligning Llama 3with human feedback involves six rounds of iter-ative refinement. Each round includes supervisedfine-tuning (SFT) followed by DPO, with the fi-nal model being an average of the outputs from allrounds. For each round, a reward model (RM) istrained on newly collected preference annotationdata, targeting a wide range of capabilities builtupon the pre-trained checkpoint. After SFT, DPOis applied to further optimize the SFT models, us-ing recent preference data batches obtained fromthe best-performing models of previous rounds. Toenhance the stability of DPO training, two key ad-justments are implemented: masking out format-ting tokens in the DPO loss and introducing reg-ularization via an NLL (negative log-likelihood)loss.

      Qúa trình hậu huấn luyện của Llama 3 bao gồm 6 vòng lặp tinh chỉnh. Mỗi vòng bao gồm việc SFT sau đó đên DPO. cùng với việc mô hình cuối cùng là trung bình cộng của đầu ra tại tất cả các vòng. Ở mỗi vòng, một reward model được huấn luyện trên một tập dữ liệu preference được thu thập mới, nhắm đến một loạt các khả năng được xây dựng dựa trên các checkpoint của pre-train trước đó. Sau SFT, DPI được áp dụng, sử dụng các dữ liệu preference hiện có thu được từ các mô hình tốt nhất ở các vòng trước đó. Để tăng tính ổn định trong huấn luyện DPO, 2 điều chỉnh đã được tích hợp: che các token dùng để bố cục khỏi hàm mất mát DPO và sử dụng regularization thông qua hàm mất mát NLL.

    10. Gemini implements a post-training process thatutilizes an optimized feedback loop, collectinghuman-AI interactions to drive continuous improve-ment in key performance areas. During the post-training’s RLHF phase, an iterative approach isadopted wherein reinforcement learning (RL) in-crementally enhances the reward model (RM). Con-currently, the RM undergoes continuous refinementthrough systematic evaluation and data collection.This dynamic interplay promotes ongoing advance-ment in both RL and RM, leading to progressivelyimproved performance over time

      Gemini cài đặt một quá trình hậu huấn luyện, tổng hợp một vòng lặp phản hồi được tối ưu, thu thập các tương tác giữa con người và AI để hướng đến sự cải tiến liên tục trên nhiều lĩnh vực chủ chốt. Trong quá trình hậu huấn luyện của RLHF, một cách tiếp cận vòng lặp được cài đặt mà trong đó, RL liên tục cải tiến reward model. Đồng thời, reward model cũng trải qua quá trình tinh chỉnh liên tục thông qua đánh giá có hệ thống và thu thập dữ liệu.

    11. GPT-4 leverages RLHF methods, as outlinedin InstructGPT (Ouyang et al., 2022) which wehave describe in Sec 3.1, in the post-training align-ment stage. To steer the models more effectivelytowards appropriate refusals at a finer level, theauthors further use a zero-shot GPT-4 classifier asthe rule-based reward model (RBRM). This RBRMprovides an additional reward signal to the GPT-4policy model during PPO fine-tuning on a subsetof training prompts. The RBRM takes a prompt(optional), the policy model’s output, and a human-written rubric (e.g., a set of rules in multiple-choicestyle) as input, then classifies the output accord-ing to the rubric. Through this approach, GPT-4is rewarded for refusing harmful content and forappropriately responding to known-safe prompts.

      GPT-4 tận dụng các phương pháp RLHF, như được mô tả trong InstructGPT. Ngoài ra, để chỉ đạo các mô hình hướng đến việc có thể đưa ra các lời từ chối phù hợp một cách hiệu quả hơn ở một mức độ cao hơn, các tác giả đã sử dụng một mô hình zero-shot GPT-4 classifier như là một rule-based reward model (RBRM). Mô hình này cung cấp một tín hiệu reward bổ sung vào mô hình policy của GPT-4 trong quá trình fine-tune PPO với 1 tập nhỏ của bộ dữ liệu huấn luyện. RBRM lấy 1 prompt, đầu ra của mô hình policy, và tập các đầu mục được viết bởi người (một tập các luật được viết bằng phong cách multiple-choice) làm đầu vào, sau đó phân loại đầu ra dựa trên tập các đầu mục đó. Thông qua cách tiếp cận này, GPT-4 được thưởng khi từ chối các nội dung độc hại và phản hồi một cách hợp lý các nội dung an toàn.

    12. 1. Traditional RL approaches, such as Reinforce-ment Learning from Human Feedback (RLHF)and Reinforcement Learning from AI Feedback(RLAIF). These methods require training a rewardmodel and involve a complex and often unstableprocess, using algorithms like Proximal Policy Op-timization (PPO) (Schulman et al., 2017) to opti-mize the policy model. Models like InstructGPT(Ouyang et al., 2022), GPT-4 (OpenAI, 2023), andClaude 3 (Anthropic, 2024) follow this approach.2. Simplified approaches, such as Direct Prefer-ence Optimization (DPO) (Rafailov et al., 2024)and Reward-aware Preference Optimization (RPO)(Adler et al., 2024). These methods discard thereward model, offering a stable, performant, andcomputationally efficient solution. Models likeLlama 3 (Dubey et al., 2024), Qwen 2 (Yang et al.,2024a), and Nemotron-4 340B (Adler et al., 2024)follow this approach. In this section, we providea detailed description of each model, starting witha brief overview of these RL enhanced LLMs andfollowed by an explanation of how RL is applied intheir post-training process. An overview of these

      2 hướng RL chính được sử dụng trong các mô hình LLM hiện nay: - RL truyền thống (RLHF hoặc RLAIF): Các phương pháp này yêu cầu huấn luyện ra 1 reward model. Đặc điểm: quá trình huấn luyện phức tạp và thường không ổn định. Điển hình là thuật toán PPO. Các mô hình như InstructGPT, GPT-4, Claude-3 đều sử dụng phương pháp này

      • RL đơn giản hóa (DPO, RPO): các phương pháp này loại bỏ reward model, thay vào đó đề xuất hướng giải quyết ổn định và hiệu quả hơn về mặt tính toán. Các mô hình như Llama 3, Qwen 2 và Nemotron-4 30B đều đi theo hướng này
    13. Step 1: Collect comparison data, and traina reward model. Ouyang et al. (2022) collectsa dataset of comparisons between outputs of theinstruction-tuned model, where labelers indicatewhich output they prefer for a given input. Then,the collected dataset is used to train a reward model(RM) to predict the human-preferred output.Step 2: Optimize a policy against the rewardmodel using PPO. Ouyang et al. (2022) leveragesthe output of the RM as a scalar reward, and fine-tunes the instruction-tuned model to optimize thisreward using the PPO algorithm (Schulman et al.,2017).

      Bước 1: Thu thập dữ liệu so sánh và huấn luyện reward model: - Thu thập các đoạn văn bản được sinh bởi mô hình đã được instruction-tune và ghép cặp các đoạn. Sau đó người gán nhãn sẽ đánh giá đoạn nào là tốt hơn. Sau đó,

      Bước 2: Tối ưu policy với reward model sử dụng PPO: đầu ra của reward model được sử dụng làm reward, dùng để fune-tune mô hình đã được instruction-tune trước đó để tối ưu reward có sử dụng thuật toán PPO.

    14. e have outlined the general framework of RLabove; now we will delve into the process of fine-tuning LLMs using RL. This approach aims to alignLLMs with desired behaviors, enhance their per-formance, and ensure that their outputs are botheffective and dependable.

      Mục tiêu của việc áp dụng RL vào LLM: - Gán các cách cư xử hợp lý cho LLM. - Nâng cao hiệu xuất - Đảm bảo đầu ra vừa hiệu quả, vừa có thể dựa vào.

    1. or the RM architecture, we use pre-trained transformer-based language models with the last unem-bedding layer removed and add an additional linear layer to the final transformer layer. Given anytext, the reward model will assign a scalar reward value to the last token, and the larger the rewardvalue, the better the sample. Following Stiennon et al. [25], training reward models often involvesutilizing a dataset comprised of paired comparisons between two responses generated for the sameinput. The modeling loss for each pair of preferred and dispreferred samples is:

      Kiến trúc của reward model: sử dụng mô hình pretrain có kiến trúc transformers với lớp embedding cuối bị loại bỏ và một lớp linear được thêm vào lớp transformers cuối cùng. Khi được đưa 1 đoạn text bất kì, reward model sẽ đưa ra 1 giá trị vô hướng và với giá trị càng lớn, đoạn text càng tốt.

    2. PPO workflow, depicting the sequential steps in the algorithm’s execution. The processbegins with sampling from the environment, followed by the application of GAE for improvedadvantage approximation. The diagram then illustrates the computation of various loss functionsemployed in PPO, signifying the iterative nature of the learning process and the policy updatesderived from these losses.

      Luồng làm việc của PPO, thể hiện các bước tuần tự của thuật toán.

    3. In this report, we carefully dissect the framework of RLHF and discuss the entire process thatdetermines the success of the algorithm’s training. We explored how the quality of the reward modelaffects the final result of the policy model. We find that the quality of the reward model directlydetermines the upper bound of the policy model, and designing an appropriate PPO algorithm is crucialfor RLHF’s successful training. Moreover, accurate code implementation matters in deep policy(practice makes perfect). Therefore, we have conducted in-depth evaluations of the inner workingsof PPO algorithm to study how code-level and theory-level optimizations change agent trainingdynamics. We propose to monitor the PPO training process by using action space modeling metricsderived from the policy model, such as perplexity, response length, and KL divergence betweenthe policy model and the SFT model. These metrics are more informative of the training stabilitythan the values of response reward and loss functions. Based on these observations, we identify thepolicy constraints in the PPO algorithm as the key factor to achieve consistent alignment with humanpreferences. After extensive comparative experiments with various possible implementations of PPOframework, we finally introduce a preferable policy optimization algorithm named PPO-max, whichincorporates the collection of effective and essential implementations, and is carefully calibratedto avoid interference among them. PPO-max alleviates the instability of vanilla PPO training andenables longer training steps with a larger training corpus. We evaluate PPO-max on 7B and 13BSFT models, demonstrating comparable alignment performance with ChatGPT
      • Khám phá ra rằng chất lượng của reward model trực tiếp xác định cận trên của mô hình gốc. và việc thiết kế thuật toán PPO một cách hợp lý là rất quan trọng để huấn luyện rlhf.
      • Đề xuất theo dõi quá trình huấn luyện PPO bằng cách sử dụng các chỉ số mô hình hóa không gian hành động được rút ra từ mô hình policy (perplexity, response lengh, khoảng cách KL giữa mô hình policy và SFT). Các chỉ số này chứa nhiều thông tin về tính ổn định khi huấn luyện hơn là các giá tri của phản hồi và hàm mất mát.

      => Dựa trên các quan sát trên, các ràng buộc về policy trong thuật toán PPO được xác định là nhân tố chính trong việc gán sự yêu thích của con người lên mô hình một cách bền vững.

      Đóng góp: giới thiệu một thuật toán tối ưu mới có tên PPO-max, tích hợp một loạt các cải tiến cần thiết và hiệu quả, và được tinh chỉnh cẩn thận để tránh xung đột giữa các cải tiến. PPO-max hạn chế sự bất ổn của quá trình huấn luyện PPO cổ điển và cho phép các bước huấn luyện dài hơn với tập ngữ liệu lớn hơn.

  4. Jan 2025
    1. Q1: How do the quality, dimensionality, andgranularity of LLM-generated feedback (C1–C4 inTable 2) influence preference learning?Q2: What impact does each dimension have inthe case of multi-dimensional feedback?Q3: How much can DPO enhance the quality ofsummaries compared to SFT variants

      3 câu hỏi được đặt ra: - Chât lượng, tính đa chiều và tính mịn của LLM feedback ảnh hướng đến quá trình huấn luyện ntn - Ảnh hưởng của từng khía cạnh trong chấm điểm feedback - DPO nâng cao chất lượng của bản tóm tắt lên bao nhiêu so với SFT

    2. Coarse-grained evaluation uses a Likert scale (1–5), butthese subjective scores often skew toward higherratings due to a lack of grounding (Wang et al.,2023; Liu et al., 2023a). In contrast, fine-grainedevaluation assesses at the sentence or key-fact level,measuring faithfulness, completeness, and concise-ness through factual sentence proportions and key-fact coverage, yielding percentage scores bettercorrelate with human feedback (Song et al., 2024).Thus, all summary–document pairs are subjectedto LLM-based summarization evaluation for eachconfiguration. 125K summary-document pairs re-main after excluding failed and special cases.2More details including evaluation prompts, method-ologies, and data statistics are in Appendix A.

      Đánh giá thô sử dụng Likert (1-5) thường có xu hướng ngả về điểm qua vì thuế sự làm tròn. Ngược lại, đánh giá mịn giải quyết vấn đề ở mức câu và các thông tin quan trọng (key-fact), tính điểm trung thực, đầy đủ và tính ngắn gọn thông qua tỉ lệ bao phủ ở mức câu và key-fact, từ đó cho thấy điểm phần trăm có tương quan tốt với feedback của con người.

    3. Feedback Dimensionality (C2 vs. C3): The sim-plest way to gather feedback is to assess the qualityof the summary with a single score on a 1–5 Likert2We exclude cases where the document length exceeds themodel’s capacity (8K tokens by Llama3 on a single NVIDIAH100 GPU), as well as instances of erroneous feedback fromthe LLMs, such as incomplete or nonsensical responses.scale (Wang et al., 2023). However, it overlookskey multi-dimensional aspects of summary quality,such as faithfulness, completeness, and concise-ness (Lee et al., 2024). Therefore, a more advancedapproach involves conducting a multi-dimensionalevaluation using LLMs across these three dimen-sions, yielding a separate score for each (Zhonget al., 2022; Liu et al., 2023a).

      Tính đa chiều của feedback: Cách đơn giản nhất để thu thập feedback là đánh giá chất lượng của bản tóm tắt với điểm với điểm đơn thuần từ 1-5. Tuy nhiên, phương pháp này bỏ qua các khía cạnh khác trong chất lượng của bản tóm tắt, như tính trung thực, tính đầy đủ và tính ngắn gọn. Vì vậy, một hướng tiếp cận tốt hơn liên quan đến việc tiến hành đánh giá đa phương diện sử dụng LLM

    4. Feedback Quality (C1 vs. C2): The quality ofgenerated feedback plays a pivotal role in prefer-ence learning. To assess the importance of feed-back quality, we adjust the capacity of the selectedLLMs for feedback generation. We use two open-source LLMs of different sizes: Llama3-8b-instructfor low-quality feedback and Llama3-70b-instructfor high-quality feedback, respectively

      Chất lượng của feedback: đóng vai trò trụ cột trong việc học dựa trên sở thích. Để đo lường được tầm quan trọng của chất lượng feedback, sức mạnh của các LLM được chọn để tạo feedback được điều chỉnh. Cụ thể: C1: sử dụng Llama3-8b-instruct tạo feedback chất lượng thấp C2: sử dụng Llama3-70b-instruct tạo feedback chất lượng cao

    5. Feed-back is generated through LLM-based summaryevaluations using four configurations, adjustingthe quality (low vs. high), dimensionality (singlevs. multi-dimensional), and granularity (coarse- vs.fine-grained) of the feedback.

      Feedback được sinh thông qua các đánh giá bản tóm tắt dựa trên llm, sử dụng 4 cấu hình, trong đó có sự điều chỉnh về chất lượng (thấp vs cao), độ đa dạng (1 chiều hay đa chiều) và tính mịn (thô hay mịn) của feedback

    6. In this work, we integrate automated evaluationinto preference learning, enabling large-scale, fine-grained feedback that addresses three key align-ment dimensions of text summarization: faithful-ness, completeness, and conciseness

      Trong nghiên cứu này, đánh giá tự động được tích hợp vào việc học dựa trên sở thích, cho phép feedback có thể đề cập trực tiếp đến 3 tiêu chí của bài toán tóm tắt: tính trung thực, tính đầu đủ và tính ngắn gọn.

    7. (1) We create andrelease FeedSum, the first large-scale summariza-tion dataset for preference learning, featuring highdiversity in inputs, summaries, and feedback; (2)We examine how different configurations of LLM-generated feedback impact preference learning, andthe importance of feedback quality, dimensional-ity, and granularity. (3) We examine the alignmenttrade-off associated with relying on a single dimen-sion for preference learning. (4) We compare theeffectiveness of DPO and SFT variants. (5) Werelease SummLlama3-8b, which outperforms thenearly 10x larger Llama3-70b-instruct in the threehuman-preferred dimensions.

      Đóng góp chính - Tạo ra bộ FeedSum, có tính đa dạng cao. - Kiểm tra xem với mỗi cấu hình feedback của LLM sẽ tác động đến việc học như thế nào và tầm quan trọng của chất lượng feedback, tính đa chiều và tính mịn. - Kiểm tra tính trade-off liên quan đến việc dựa vào 1 chiều để học - So sánh hiệu quả của các phiên bản DPO và SFT. - Công bố LLM

    8. Each setup generates 125K pairs of in-put documents and summaries, accompanied bydistinct LLM-generated feedback responses. In

      Mỗi setup sinh 125k cặp tài liệu đầu vào-tóm tắt, kèm với các phản hồi feedback của LLM.

    9. from LLM feedback, focusing on three key openquestions: (Q1) The impact of these three factorson the effectiveness of preference learning; (Q2)An analysis on the effectiveness of each dimen-sion in multi-dimensional feedback; and (Q3) Acomparison between two approaches for utilizingLLM-generated feedback: supervised fine-tuning(SFT) and direct preference optimization (DPO).

      Thông qua thử nghiệm toàn diện trên bộ FeedSum, cung cấp cái nhìn về việc học bài toán tóm tắt từ feedback của LLM, tập trung vào 3 câu hỏi chính: - Tác động của 3 yếu tố trên lên sự hiệu quả của việc học dựa trên sở thích. - Phân tích về độ hiệu quả của mỗi chiều đối với feedback đa chiều. - So sánh giữa 2 cách tiếp cận để tối ưu feedback của LLM: SFT và DPO.

    10. To obtain summaries with vary-ing levels of quality, we generate them using 13different language models, including 3 non-LLMs(e.g., Bart), 7 open-source LLMs (e.g., Llama3),and 3 proprietary LLMs (e.g., GPT-4-turbo). Forsummary generation, these models are applied toa diverse range of input documents, spanning bothshort and lengthy texts, including dialogue and non-dialogue formats, and across 7 distinct domains.

      Để có được các bản tóm tắt với nhiều chất lượng khác nhau, các bản tóm tắt này được tạo bởi 13 mô hình khác nhau, được chia thành 3 nhóm: - Mô hình không phải LLM - Mô hình LLM - LLM kín (của các công ti) Các văn bản được tóm tắt thuộc nhiều loại khác nhau, từ ngắn đến dài (xét theo dung lượng) và thuộc 7 chủ đề khác nhau,

    11. Figure 1 illustrates our com-plete pipeline for learning from LLM-generatedfeedback, consisting of data sourcing, feedbackgeneration, and preference learning

      Hình 1 mô tả pipeline hoàn chỉnh cho việc học từ feedback gen bởi LLM, bao gồm lấy data, tạo feedback và học từ sở thích

  5. Dec 2024
    1. The effectiveness of LLM feedback on prefer-ence learning can vary based on three factors, in-cluding the quality of the feedback (e.g., low vs.high), its dimensionality (e.g., single vs. multiple),and its level of granularity in scoring (e.g., coarsevs. fine)

      Hiệu quả của phản hồi LLM đối với việc học của mô hình có thể biến đổi dựa trên 3 yếu tố chính, bao gồm chất lượng của phản hồi, tính đa dạng (đơn điệu hay nhiều), mức độ chi tiết trong việc chấm điểm (thô hay mịn...)

    2. While large language models (LLMs)have greatly improved the coherence and fluencyof summaries (Liu et al., 2023a), persistent issuesremain, such as unfaithful statements (hallucina-tions), omission of key information (low complete-* Corresponding Author.† This work is conducted independently and is not relatedto the author(s)’ position at Hyperconnect and Amazon.ness), and verbosity (low conciseness) in the sum-maries (Lee et al., 2024; Song et al., 2024)

      Trong khi LLM cải thiện rõ rệt tính mạch lạc và trôi chảy của bản tóm tắt, một số vấn đề vẫn còn tốn đọng: thiếu trung thực, thiếu thông tin quan trọng và dài dòng.

    3. Our approach shifts focus to the relatively unex-plored area of leveraging LLM-generated feedbackto enhance summary quality, whereas most exist-ing research in summarization has primarily con-centrated on using LLMs to evaluate summaries.(Wan et al., 2024; Tang et al., 2024a; Song et al.,2024). Specifically, our goal is to produce human-preferred summaries by exploiting LLM feedbackwith respect to the three core dimensions, namelyfaithfulness, ensuring summaries are consistentwith original documents; completeness, encompass-ing all key-facts1; and conciseness, maintaining asuccinct and focused summary.

      Nghiên cứu của bài báo chuyển sự chú ý sang việc tận dụng phản hồi được tạo bởi LLM để làm tăng chất lượng của bản tóm tắt, trong khi đa số các nghiên cứu hiện nay tập trung vào việc sử dụng LLM để đánh giá bản tóm tắt. Cụ thể, mục tiêu là tóm tắt các bản tóm tắt tốt bằng việc khai thác phản hồi của LLM trên 3 tiêu chí chính: Độ trung thực, độ hoàn thiện và độ xúc tích.

    4. Developing effective text summarizers remainsa challenge due to issues like hallucinations,key information omissions, and verbosity inLLM-generated summaries. This work ex-plores using LLM-generated feedback to im-prove summary quality by aligning the sum-maries with human preferences for faithful-ness, completeness, and conciseness. We in-troduce FeedSum, a large-scale dataset con-taining multi-dimensional LLM feedback onsummaries of varying quality across diversedomains. Our experiments show how feed-back quality, dimensionality, and granularityinfluence preference learning, revealing thathigh-quality, multi-dimensional, fine-grainedfeedback significantly improves summary gen-eration. We also compare two methods for us-ing this feedback: supervised fine-tuning anddirect preference optimization. Finally, we in-troduce SummLlama3-8b, a model that out-performs the nearly 10x larger Llama3-70b-instruct in generating human-preferred sum-maries, demonstrating that smaller modelscan achieve superior performance with appro-priate training. The full dataset will be re-leased soon. The SummLlama3-8B model isnow available at https://huggingface.co/DISLab/SummLlama3-8B

      Đóng góp chính: - giới thiệu bộ dữ liệu FeedSum, chứa phản hồi của LLM trên nhiều phương thức với nhiều chất lượng khác nhau, trải dài trên nhiều lĩnh vực. - So sánh 2 phương pháp sử dụng phản hồi từ LLM: sử dụng SFT và DPO. - Giới thiệu mô hình tóm tắt: SummLlama3-8b

    1. Figure 9(b) presents the results of of PaLM 2-L as the scorer LLM with the following options ofinitial instructions: (1) “Let’s solve the problem.”; (2) the empty string; or (3) “Let’s think stepby step.”. We notice that the performance differs much more with different initial instructions,especially at the beginning of the optimization. Specifically, starting from (1) leads to better generatedinstructions than (2) in the first 30 steps, while the instructions optimized from both (1) and (2)are worse than (3) throughout. A similar observation holds when using PaLM 2-L as scorer andgpt-3.5-turbo as optimizer for BBH tasks, by comparing the results starting from the emptystring (Appendix E.2) and from “Let’s solve the problem.” (Appendix E.3). Taking a closer look intothe optimization process of (2), we find that although both “solve the problem” and “step by step”show up in generated instructions at Step 5, it takes the optimizer LLM more steps to get rid of worseinstructions presented in the meta-prompt when starting from instructions with lower accuracies.Therefore, one direction for future work is to accelerate convergence from weaker starting points.

      Hình 9b thể hiện kết quả của PaLM 2-L khi làm scorer LLM với các prompt khởi tạo sau: - "Let's solve the problem" - Prompt rỗng - "Let's think step by step"

    2. The number of generated instructions per step. Computing a mini-batch of gradients reducesthe variance of a stochastic gradient descent procedure. Similarly, generating multiple instructionsin each step improves the optimization stability with LLMs. On the other hand, to achieve betterperformance with a fixed budget for the number of instructions to evaluate, the number of per-stepinstructions should not be too large, so as to allow more optimization steps to incorporate richerinformation of past instructions with their accuracies. Taking both aspects into consideration, Figure 8compares the optimization performance of sampling 1 / 2 / 4 / 8 (default) / 16 instructions in eachstep, showing that sampling 8 instructions at each step overall achieves the best performance

      Số lượng chỉ dẫn được tạo ra ở mỗi bước: Việc tính toán một mini-batch của đạo hàm làm giảm phương sai của việc xuống đồi đạo hàm ngẫu nhiên. Tương tự như vậy, việc tạo ra nhiều chỉ dẫn dúng làm tăng khả năng tối ưu của LLM. Mặt khác

    3. Meta-prompt design. The meta-prompt design is crucial in achieving good prompt optimizationperformance. We investigate the following core design choices:• The order of the previous instructions. We compare the following options: (1) from lowest tohighest (our default setting); (2) from highest to lowest; (3) random. Figures 7(a) and 7(b) showthat the default setting achieves better final accuracies and converges faster. One hypothesis isthat the optimizer LLM output is affected more by the past instructions closer to the end of themeta-prompt. This is consistent with the recency bias observed in Zhao et al. (2021), whichstates that LLMs are more likely to generate tokens similar to the end of the prompt.• The effect of instruction scores. In terms of how to present the accuracy scores, we compare threeoptions: (1) rounding the accuracies to integers, which is equivalent to bucketizing the accuracyscores to 100 buckets (our default setting); (2) bucketizing the accuracies to 20 buckets; (3)not showing the accuracies, only showing the instructions in the ascending order. Figures 7(c)and 7(d) show that the accuracy scores assists the optimizer LLM in better understanding thequality difference among previous instructions, and thus the optimizer LLM proposes better newinstructions that are similar to the best ones in the input optimization trajectory.• The effect of exemplars. We compare three options: (1) showing 3 exemplars from the task(default); (2) showing 10 exemplars from the task; (3) no exemplars

      Cách thiết kế meta-prompt: - Thứ tự của các chỉ dẫn trước đó: so sánh các cài đặt sau với nhau: + Từ thấp nhất đến cao nhất (mặc định) + Từ cao nhất đến thấp nhất + Ngẫu nhiên Hình 7 cho thấy cài đặt mặc định có kết quả tốt hơn và hội tụ nhanh hơn. Gỉa thiết được đưa ra cho hiện tượng này là do đầu ra của optimizer LLM bị ảnh hưởng bởi các chỉ dẫn trước đó mà ở gần meta-prompt hơn. Điều này phù hợp với thiên lệch ở gần (recency bias) cho rằng LLM có xu hướng tạo ra các token tương đồng với phần cuối của prompt.

      • Tác động của điểm chỉ dẫn: Đối với việc thể hiện điểm accuracy, 3 cài đặt được so sánh:
      • Làm tròn điểm thành số tự nhiên
      • Gom nhóm các điểm thành 20 nhóm.
      • Không ghi điểm, chỉ ghi các chỉ dẫn theo thứ tự giảm dần của điểm. Hình 7c và 7d cho thấy các điểm accuracy hỗ trợ optimizer LLM trong việc hiểu về chất lượng của các chỉ dẫn trước, từ đó LLM có thể đưa ra các chỉ dẫn tốt hơn, tương đồng với các chỉ dẫn tốt nhất

      • Tác động của các ví dụ: 3 lựa chọn được so sánh:

      • Ghi 3 ví dụ từ bái toán
      • Ghi 10 ví dụ từ bài toán
      • Không có Hình 7e và 7F cho thấy việc thể hiện các ví dụ trong meta-prompt là vô cùng quan trọng, bởi nó cung cấp thông tin về bài toán và giúp optimizer LLM có thể tạo các chỉ dẫn tốt hơn. Tuy nhiên, việc có nhiều hơn các ví dụ không phải lúc nào cũng dẫn đến việc cải thiện kết quả. Hơn nữa, việc có nhiều ví dụ còn dẫn đến việc meta-prompt bị dài hơn với phần ví dụ dài hơn các phần khác, dẫn đến việc LLM dễ bị xao nhãng mà không chú ý các phần quan trọng khác.
    4. One challenge of prompt optimization is the sensitivity of model performance to subtle changes inthe instruction. For example, with the PaLM 2-L scorer on the GSM8K test set, “Let’s think stepby step.” achieves accuracy 71.8, “Let’s solve the problem together.” has accuracy 60.5, while theaccuracy of “Let’s work together to solve this problem step by step.” is only 49.4, although it is thesemantic combination of the two upper instructions. This behavior increases both the variance acrosssingle-step instructions and the oscillation during optimization, and motivates us to generate multipleinstructions at each step to improve the optimization st

      Các chỉ dẫn tương đồng về mặt ngữ cảnh có thể đạt được các kết quả có sự khác biệt lớn: Thách thức của bài toán tối ưu prompt là sự nhạy cảm về hiệu suất của mô hình đối với các thay đổi nhỏ trong chỉ dẫn. Ví dụ: với scorer là PaLM 2-L trên bộ test của GSM8K, chỉ dẫn "Let's think step-by-step" đạt điểm accuracy 71.8, "Let's solve the problem together" có điểm accuracy 60.5, trong khi điểm accuracy của prompt "Let's work together to solve this problem step-by-step" chỉ là 49.4, mặc dù nó là sự kết hợp ngữ nghĩa của 2 prompt trước đó. Đặc điểm này tăng cả phương sai giữa các chỉ dẫn một bước và các giao động trong quá trình tối ưu hóa, từ đó thúc đẩy việc tạo sinh ra nhiều chỉ dẫn ở mỗi bước để làm tăng tính ổn định trong tối ưu

    5. We assess the transferability of found prompts to different datasets of the same domain, where weevaluate the top instructions found for GSM8K on two more math reasoning benchmarks Multi-Arith (Roy & Roth, 2016) and AQuA (Ling et al., 2017). Table 6 shows that our optimized promptsalso outperform baseline prompts with different scorer LLMs on these two benchmarks

      Tính chuyển hoa của các chỉ dẫn được tìm ra: Việc có thể áp dụng các chỉ dẫn được tìm ra sang các bộ dữ liệu khác có cùng lĩnh vực được khám phá. Các chỉ dẫn tốt nhất ở bộ GSM8K sẽ được dùng cho 2 bộ dữ liệu toán khá là Multi-Arith và AQuA.

    6. Similar to GSM8K, we observe upward trends in optimization curves on almost all BBH tasks, asshown in Figure 6. See Figure 23 and 24 in Appendix D for more curves on other BBH tasks.We next show some examples of instructions found through the course of optimization. On the taskruin_names, starting from the empty instruction (with 64.0 training accuracy), with the text-bisonscorer and the PaLM 2-L-IT optimizer, the following instructions are generated:• “Consider the following when editing artist or movie names humorously:” at Step 1 with trainingaccuracy 72.0;• “When making humorous edits of artist or movie names, you can change one or more letters oreven create puns by adding new words that sound similar.” at Step 18 with training accuracy80.0;• “We can make humorous edits of artist/movie names by changing letters to create new wordsthat are similar in sound but have different meanings. For example, The Police can be changedto The Polite, The Abyss can be changed to Toe Abyss, and Schindler’s List can be changed toSchindler’s Lost.” at Step 38 with training accuracy 82.0.Although the above instructions are semantically similar, a paraphrase by the optimizer LLM offers anotable accuracy improvement. We further highlight this observation in Section 5.2.3.

      Tương tự như ở GSM8K, có thể thấy chiều hướng đi lên trong quá trình tối ưu hóa ở hầu hết tất cả các bài toán BBH Một số ví dụ về chỉ dẫn được sinh ra trong quá trình tối ưu. Ở bài toán ruin_names, bắt đầu với chỉ dẫn rỗng (điểm accuracy 64), với text-bison làm scorer và PaLM 2-L-IT làm optimizer, các chỉ dẫn sau đây được sinh ra: - ........ ở step 1 với điểm accuracy 72 - ........ ở step 18 với điểm accuracy 80.0 - ......... ở step 38 có điểm accuracy 82.0 Mặc dù các chỉ dẫn trên đều gần như tương đồng về mặt ngữ cảnh, việc cải biên lại được thực hiện bởi LLM cho phép điểm accuracy được gia tăng đáng kể.

    7. Figure 5 visualizes the per-task accuracy difference on all 23 BBH tasks compared to the instruction“Let’s think step by step.” (Kojima et al., 2022) and the empty instruction, and we present the concreteaccuracies in Table 7 of Appendix E. We show that the instructions found by OPRO outperform“Let’s think step by step.” on almost all tasks by a large margin: our instructions outperform by over5% on 19/23 tasks with the PaLM 2-L scorer, and on 15/23 tasks with the text-bison scorer.Our prompt optimization algorithm also improves instructions from the empty starting point by over5% on most tasks: 20/23 with the PaLM 2-L scorer and 15/23 with the text-bison scorer

      Bảng 5 thể hiện kết quả ở mỗi bài toán con ở tất cả 23 bài toán con của OPRO so với chỉ dẫn "Let's think step by step" và chỉ dẫn rỗng. Kết quả cho thất OPRO tốt hơn nhiều ở hầu hết tất cả các bài toán:

    8. For each task, we utilize a subset of 20% examples for prompt optimization, andthe rest examples are for testing. We show experimental results on more variants of the instructionposition and initialization in Appendix

      Với mỗi bài toán con trong bộ dữ liệu BBH, một lượng 20% các ví dụ sẽ được sử dụng trong tối ưu và phần còn lại để kiểm thử.

    9. Table 4 summarizes top instructions found on GSM8K with different scorer and optimizer LLMs.We observe that:• The styles of instructions found by different optimizer LLMs vary a lot: PaLM 2-L-IT andtext-bison ones are concise, while GPT ones are long and detailed.• Although some top instructions contain the “step-by-step” phrase, most others achieve a compa-rable or better accuracy with different semantic meanings.10

      Bảng 4 tổng hợp các chỉ dẫn tốt nhất trên bài toán GSM8K với các scorer và optimizer LLM khác nhau. Nhận xét: - Các phong cách tạo chỉ dẫn của các LLM có sự khác nhau lớn: PaLM 2-L IT và text-bison thường ngắn gọn, còn GPT thì dài và nhiều chi tiết. - Mặc dù một số chỉ dẫn tốt nhất chứ cụm từ "step-by-step", tất cả các cụm khác đều đạt kết quả tương tự hoặc cao hơn với các cụm có ý nghĩa khác.

    10. Different from other optimizer LLMs that are instruction-tuned, the pre-trained PaLM 2-L performs better when the prompt is formatted in a few-shot manner.Therefore, we include two initial instructions to start the optimization: the empty instruction (witha training accuracy 32.2) and “The answer is” (with a training accuracy 33.3).

      Khác với các optimizer LLM khác được instruction-tuned, pretrained PaLM 2-L thể hiện tốt hơn khi các prompt được bố cục dưới dạng few-shot. Vì vậy, 2 chỉ dẫn khởi tạo đã được thêm vào: chỉ dẫn trống (có điểm accuracy 32.2) và chỉ dẫn "The answer is" (có điểm chỉ dẫn 33.3) Hình 21 trong appendix C thể hiện bố cục của meta-prompt.

    11. te that although our default setting is to run OPRO for 200 steps in prompt optimization, weneed much fewer steps if the goal is to find some outstanding instructions. An example is that theFigure 1(a) experiment found “Let’s do the math!” at Step 6 with training accuracy 78.2, almostmatching the “Take a deep breath and work on this problem step-by-step.” found at the 107th stepwith training accuracy 80.2, at a point where the optimization curve is still trending upwards. This isbecause a leap in our optimization curve does not always correspond to a much better instruction beingdiscovered; instead, it can be due to a large qualitative improvement of all 8 generated instructions inthis step. The latter usually happens several steps after the former: after a much better instruction isdiscovered in one step, the meta-prompt gradually gets rid of worse instructions in the latter steps bygenerating instructions similar to the much-better one. The top instructions kept in the meta-promptgradually improves in this procedure. At a point when the meta-prompt only triggers higher qualityinstructions, the leap happens

      Dù cài đặt mặc định là chạy OPRO với 200 bước để tối ưu prompt, chúng ta cần ít bước hơn rất nhiều để tìm ra các chỉ dẫn vượt trội. Một ví dụ là ở hình 1a, ở bước 6 điểm accuracy là 78.2 với prompt là "Let's do the math!", gần như tương đồng với prompt "Take a deep breath and work on this problem step-by-step" ở bước 107 với điểm accuracy 80.2, ở điểm mà tại đó việc tối ưu vấn đang có dấu hiệu tăng. Điều đó là bởi bước nhảy lớn trong việc tối ưu không phải lúc nào cũng ứng với một chỉ dẫn tốt hơn nhiều được sinh ra mà thay vào đó, nó có thể là do sự cải tiến lớn về chất lượng của tất cả 8 chỉ dẫn được tạo ở bước đó.

      Cụ thể, sau khi 1 chỉ dẫn tốt hơn nhiều được tạo ra, meta-prompt sẽ dần dần từ bỏ các chỉ dẫn tồi hơn ở các bước sau bằng cách tạo ra các chỉ dẫn tương tự với chỉ dẫn tốt hơn kia. Các chỉ dẫn tốt nhất được giữ lại ở meta-prompt sẽ dần dần được cải tiến theo cách này. Ở điểm mà khi đó meta-prompt chỉ đưa ra các chỉ dẫn tốt hơn, bước nhảy vọt mới xảy ra.

    12. The optimization curves also generally show a decrease of the variance among the accuracies ofinstructions generated at each step, indicating that the optimizer LLM generates distributionallybetter instructions throughout the optimization.

      Biểu đồ tối ưu còn cho thấy sự giảm trong phương sai giữa điểm accuracy của các chỉ dẫn được sinh ở mỗi bước. từ đó cho thấy LLM tạo sinh ra các chỉ dẫn tốt hơn về mặt phân phối xuyên suốt quá trình tối ưu.

    13. We observe that the optimization curveshows an overall upward trend with several leaps throughout the optimization process

      Kết quả chủ đạo có xu hướng tăng cùng với một vài bước cải tiến đáng kể xuyên suốt quá trình tối ưu hóa.

    14. Section 1 shows prompt optimization curves with pre-trained PaLM 2-L as scorerand PaLM 2-L-IT as optimizer, and the initial instruction is “Let’s solve the problem” with a(approximated, and same below) training accuracy of 60.5.

      prompt khởi tạo được sử dụng là :Let's solve the problem" với điểm accuracy trên tập huấn luyện là 60.5

    15. For prompt optimization, we randomly sample 3.5% examples from the GSM8K training set. Thesame subset is used throughout optimization, so that the task accuracies computed at intermediateoptimization steps are approximations of the training accuracy on all 7,473 training examples. Thisbalances the evaluation cost with the generalization performance. After the optimization procedurefinishes, we evaluate the found instructions on the entire GSM8K test set.

      Tập huấn luyện dùng cho LLM optimization: 3.5% số lượng mẫu được chọn ngẫu nhiên từ bộ huấn luyện của GSM8K.

    16. We would like to note that OPRO is designed for neither outperforming the state-of-the-art gradient-based optimization algorithms for continuous mathematical optimization, norsurpassing the performance of specialized solvers for classical combinatorial optimization problemssuch as TSP. Instead, the goal is to demonstrate that LLMs are able to optimize different kindsof objective functions simply through prompting, and reach the global optimum for some small-scale problems. Our evaluation reveals several limitations of OPRO for mathematical optimization.Specifically, the length limit of the LLM context window makes it hard to fit large-scale optimizationproblem descriptions in the prompt, e.g., linear regression with high-dimensional data, and travelingsalesman problems with a large set of nodes to visit. In addition, the optimization landscape of someobjective functions are too bumpy for the LLM to propose a correct descending direction, causing theoptimization to get stuck halfway. We further elaborate our observed failure cases in Appendix A.

      Hạn chế: Cần lưu ý rằng OPRO được thiết kế không phải để đạt kết quả cao hơn so với các thuật toán tối ưu SOTA hay các thuật toán chuyên biệt cho các bài toán tối ưu kinh điển như TSP. Thay vào đó, mục tiêu của OPRO là chứng minh LLM có thể tối ưu hóa nhiều bài toán khác nhau chỉ thông qua việc prompting và đạt được kết quả tối ưu toàn cục ở các bài toán có quy mô nhỏ. Đánh giá kết quả cũng cho thấy một số hạn chế của OPRO trong việc tối ưu toán học. Cụ thể, giới hạn độ dài của cửa số ngữ cảnh LLM khiến việc mô tả các bài toán tối ưu có quy mô lớn bằng ngôn ngữ tự nhiên trở nên khó khăn (ví dụ: hồi quy tuyến tính trên nhiều chiều và TSP với nhiều node). Ngoài ra, bối cảnh tối ưu của một số bài toán cũng không ổn định để LLM có thể đưa ra một hướng giải quyết hội tụ. khiến cho việc tối ưu bị chững lại

    17. On the other hand, the performance of OPRO degrades dramatically on problems with larger sizes.When n = 10, all LLMs find the optimal solutions for every evaluated problem; as the problem sizegets larger, the OPRO optimality gaps increase quickly, and the farthest insertion heuristic starts tooutperform all LLMs in the optimality gap.

      Hiệu của của OPRO giảm đi đáng kể ở các bài toán có kích thước lớn hơn. Với n = 10, tất cả LLM đêì tìm được giải pháp tối ưu với mọi bài toán. Khi bài toán dần lớn hơn, khoảng cách tối ưu của OPRO so với giải pháp ground-truth tăng lên rất nhanh, và FI bắt đầu vượt trội so với LLM.

    18. We present the results in Table 3. We randomly generate 5 problem instances for each number ofnodes n. In addition to measuring the optimality gap, on problems where the LLM finds the optimalsolutions, we also show the number of optimization steps taken to reach the global optimum. First,we observe that gpt-4 significantly outperforms gpt-3.5-turbo and text-bison across allproblem sizes. Specifically, on smaller-scale problems, gpt-4 reaches the global optimum about 4×faster than other LLMs. On larger-scale problems, especially with n = 50, gpt-4 still finds solutionswith a comparable quality to heuristic algorithms, while both text-bison and gpt-3.5-turboget stuck at local optima with up to 20× worse optimality gaps.

      Với mỗi số lượng n điểm, 5 tập điểm khác nhau sẽ được tạo ngẫu nhiên. Ngoài việc đánh giá dựa trên khoảng cách tối ưu, bài báo còn đánh giá dựa trên số lượng bước tối ưu cần thực hiện để đạt được tối ưu toàn cục. Nhận xét: - gpt-4 tốt hơn nhiều so với 2 mô hình còn lại ở tất cả các kích thước bài toán. Cụ thể, với các bài toán có kích thước nhỏ, gpt-4 đạt tối ưu toàn cục nhanh gấp 4 lần so với các mô hình khác.

    19. Nearest Neighbor (NN). Starting from an initial node, the solution is constructed withthe nearest neighbor heuristic: At each step, among the remaining nodes that are not included inthe current partial solution, NN selects the node with the shortest distance to the end node of thepartial solution, and adds it as the new end node. The process finishes when all nodes have beenadded to the solution.• Farthest Insertion (FI). One caveat of the nearest neighbor heuristic is that it doesnot take the distance between the start and end node into consideration when constructing partialsolutions. To address this issue, FI aims to optimize the cost of inserting new nodes into thepartial solution at each step. Define the minimal insertion cost of adding a new node k as
      • Nearest neighbor: Bắt đầu từ 1 điểm, giải pháp sẽ được xây dựng bằng hàm heuristic lận cận gần nhất: ở mỗi bước, giữa các điểm còn lại chưa được thêm vào, NN sẽ chọn điểm có khoảng cách gần nhất đến điểm cuối của giải pháp hiện có
      • Farthest Insertion: Một điểm không tốt của NN là nó không cân nhắc đến khoảng cách giữa điểm bắt đầu và điểm kết thúc khi xây dựng phương pháp. Để giải quyết vấn đề này, FI hướng đến mục tiêu tối ưu chi phí của việc gán các nốt mới vào giải pháp hiện có ở mỗi bước: Xác định chi phí thấp nhất của việc gán một nốt mới k sao cho:
    20. We generate the problem instances by sampling n nodes with both x and y coordinates in [−100, 100].We use the Gurobi solver (Optimization et al., 2020) to construct the oracle solutions and compute theoptimality gap for all approaches, where the optimality gap is defined as the difference between thedistance in the solution constructed by the evaluated approach and the distance achieved by the oraclesolution, divided by the distance of the oracle solution. Besides evaluating OPRO with differentLLMs including text-bison, gpt-3.5-turbo and gpt-4, we also compare OPRO to thefollowing heuristics

      Cài đặt của bài toán: - Lấy mẫu ngẫu nhiên n điểm với 2 giá trị tọa độ x và y đều nằm trong khoảng [-100, 100]. - Gurobi solver được sử dụng để tạo giải pháp ground-truth. Điểm đánh giá được sử dụng cho các giải pháp được sinh ra là khoảng cách tối ưu (optimality gap). Trong đó, khoảng cách tối ưu được định nghĩa là hiệu giữa giải pháp được tạo sinh và giải pháp ground-truth sau đó chia cho giá trị của giải pháp ground-truth.

    21. consider the Traveling Salesman Problem (TSP) (Jünger et al., 1995; Gutin & Punnen, 2006),a classical combinatorial optimization problem with numerous algorithms proposed in literature,including heuristic algorithms and solvers (Rosenkrantz et al., 1977; Golden et al., 1980; Optimizationet al., 2020; Applegate et al., 2006; Helsgaun, 2017), and approaches based on training deep neuralnetworks (Kool et al., 2019; Deudon et al., 2018; Chen & Tian, 2019; Nazari et al., 2018). Specifically,given a set of n nodes with their coordinates, the TSP task is to find the shortest route that traversesall nodes from the starting node and finally returns to the starting node.

      Mô tả bài toán Traveling salesman: Cho một tập gồm n điểm cùng với tọa độ của chúng, nhiệm vụ là tìm đường đi ngắn nhất đi qua tất cả các điểm từ điểm bắt đầu và cuối cùng trở lại điểm đó.

    22. The number of unique (w, b) pairs explored by each model is fewer than exhaustive search,indicating these models are able to to do black-box optimization: compare the numbers andpropose a descent direction.• The text-bison and gpt-4 models outperform gpt-3.5-turbo in convergence speed:they arrive at the optima with fewer steps. The gpt-4 model also outperforms in finding theoptima with fewer explored unique points. Taking a closer look at the optimization trajectory, wesee gpt-4 is the best at proposing a reasonable next step from the history: for example, whenthe history shows the objective values of (w, b) = (8, 7), (w, b) = (8, 6), and (w, b) = (8, 5)are decreasing, it has a highest chance to propose (w, b) = (8, 4) for evaluation.• The problem becomes harder for all models when the ground truth moves farther from thestarting region: all models need more explorations and more steps

      Nhận xét: - Số lượng cặp (w, b) được khám phá bởi mỗi mô hình thì ít hơn rất nhiều so với việc tìm kiếm vét cạnh, cho thấy các mô hình này có thể thực hiện tối ưu hộp đen: so sánh các con số từ đó đưa ra hướng giải quyết tốt hơn. - Bài toán trở nên khó hơn với tất cả các model khi giá trị ground truth đi xa khỏi điểm khởi đầu: tất cả các mô hình đều phải khám phá nhiều hơn với nhiều bước hơn.

    23. Both w and b startfrom 5 random starting points in [10, 20]. We use temperature 1.0 for all models. We run each setting5 times. The starting points are the same across optimizer LLMs but are different across 5 runs, andare grouped by: within the starting region, outside and close to the starting region, and outside andfarther from the starting region. Bold numbers indicate the best among three LLMs in each setting

      Cả w và b đều bắt đầu từ 5 vị trí xuất phát ngẫu nhiên trong khoảng [10, 20]. Temperature = 1.0 được sử dụng ở tất cả các model. Mỗi cài đặt được chạy 5 lần. Các điểm xuất phát là giống nhau ở tất cả các optimizer LLM nhưng khác biệt giữa 5 lần chạy. Các điểm xuất phát này được chia ra làm 3 nhóm: trong vùng xuất phát, ngoài và gần vùng xuất phát, ngoài và xa vùng xuất phát.

    24. We study three settings of wtrue and btrue: within the startingregion [10, 20] × [10, 20], “near outside” (each of wtrue and btrue is outside the starting region but thedistance is less than 10), and “far outside” (each of wtrue and btrue is outside the starting region andthe distance is greater than 10). We see:

      3 cài đặt cho giá trị của w_true và b_true: trong vùng bắt đầu ([10,20]x[10,20]), "near outside" (cả w_true và b_true đều ngoài vùng bắt đầu nhưng có khoảng cách < 10) và "far outside" (cả w_true và b_true đều ngoài vùng bắt đầu nhưng có khoảng cách > 10)

    25. Optimization problem examples. The problem description includes a few examples taken from thetraining set to demonstrate the task for the generated instructions. For example, from the input-outputpair in Figure 3, we can infer this is a math word problem. The input-output pair also demonstratesthe position where the generated instruction will be added to, and this is essential for the optimizerLLM to generate instructions of the same style. In each optimization step, we add several (three forexample) training examples to the meta-prompt by random sampling the training set or choose theones the previous instructions fall short of.Optimization trajectory. The optimization trajectory includes instructions generated from the pastoptimization steps, along with their scores. The old instructions and scores are sorted by the score inascending order. The score is the training accuracy in prompt optimization. We only keep instructionswith the highest scores in the meta-prompt in consideration of the LLM context length limit.Meta-instructions. We also add meta-instructions: the instructions to the optimizer LLM that explainthe optimization goal and instruct the model how to use the above information. The meta-instructionsmay also specify the desired generated instruction format for easier parsing.

      3 phần chính của meta-prompt, được sử dụng để tối ưu hóa prompt: - Các ví dụ trong tối ưu hóa: Mô tả bài toán bao gồm 1 vài ví dụ được lấy từ tập huấn luyện để thể hiện bài toán cho các chỉ dẫn được tạo sinh. Ví dụ, từ 1 cặp đầu vào-đầu ra, ta có thể suy ra đó là một bài toán tính toán. Cặp đầu vào-đầu ra cũng thể hiên ví trí mà chỉ dẫn tạo sinh được thêm vào, và điều này rất quan trọng cho optimizer LLM để tạo sinh các chỉ dẫn với phong cách tượng tự. Ở mỗi bước tối ưu, một vài dữ liệu huấn luyện được thêm vào meta-prompt bằng cách lấy ngẫu nhiên tập huấn luyện hoặc chọn ra các mẫu mà các chỉ dẫn trước đó đạt điểm thấp. - Lân cận trong tối ưu: Lân cận trong tối ưu bao gồm các chỉ dẫn được tạo sinh từ các bước chỉ dẫn trước, cùng với điểm của chúng. Các chỉ dẫn cũ cùng với điểm được sắp xếp theo thứ tự giảm dần. Điểm đánh giá được sử dụng là điểm accuracy trên tập train. Chỉ có các chỉ dẫn với điểm cao nhất được giữ lại và sử dụng trong meta-prompt dựa trên sự cân nhấc giới hạn độ dài ngữ cảnh của LLM. - Meta-instruction: Đây là chỉ dẫn dùng cho optimizer LLM, có vai trò giải thích mục tiêu tối ưu và cách sử dụng các thông tin được cung cấp. Meta-instruction có thể cũng cụ thể hóa bố cục của chỉ dẫn mong muốn để có thể phân tích ở các bước sau,

    26. Our primary evaluation benchmarks are GSM8K (Cobbe et al., 2021) and Big-BenchHard (BBH) (Suzgun et al., 2022). GSM8K is a benchmark of grade school math word problemswith 7,473 training samples and 1,319 test samples, where chain-of-thought prompting (Wei et al.,2022) and the zero-shot instruction “Let’s think step by step.” (Kojima et al., 2022) have drasticallyimproved the performance over the standard prompting. BBH is a suite of 23 challenging BIG-Benchtasks (Srivastava et al., 2022) that covers a wide range of topics beyond arithmetic reasoning, includingsymbolic manipulation and commonsense reasoning. Each task contains up to 250 examples in total.To examine the transferability of the optimized instructions, we also evaluate the instructions op-timized for GSM8K on two other mathematical reasoning datasets, i.e., MultiArith (Roy & Roth,2016) and AQuA (Ling et al., 2017)

      Bộ dữ liệu: Bộ dữ liệu chính được sử dụng để đánh giá là GSM8K và Big-Bench Hard (BBH). GSM8K là một bộ dữ liệu gồm các bài toán phổ thông, bao gồm 7473 mẫu huấn luyện và 1319 mẫu test, trong đó chỉ dẫn chain-of-thought và chỉ dẫn zero-shot "Lets think step by step" làm tăng đáng kể kết quả so với chỉ dẫn tiêu chuẩn. BBH là một tập chứa 23 bài toán BIG-Bench, trải dài nhiều lĩnh vực xoay quanh suy luận số học, bao gồm tính toán hình học và suy luận thường thức. Mỗi lĩnh vực có tổng cộng 250 mẫu

    27. Models. The LLMs we use as the optimizer and the scorer are:• Optimizer LLM: Pre-trained PaLM 2-L (Anil et al., 2023), instruction-tuned PaLM 2-L(denoted PaLM 2-L-IT), text-bison, gpt-3.5-turbo, and gpt-4.• Scorer LLM: Pre-trained PaLM 2-L and text-bison.With pre-trained PaLM 2-L as the scorer, the optimizer LLM generates A_begin instructions.Since text-bison has been instruction-tuned, the optimizer LLM generates Q_begin and Q_endinstructions when text-bison is used as the scorer.

      Các mô hình được sử dụng trong thực nghiệm: - Optimizer LLM: pretrained PaLM 2-L, instruction-tuned PaLM 2-L, text-bison. gpt-3.5 turbo và gpt-4 - Scorer LLM: pretrained PaLM 2-L và text-bison

      Với pretrained PaLM 2-L là scorer LLM, các optimizer LLM sẽ tạo sinh các chỉ dẫn A_begin, Còn text-bison là mô hình đã dược instruction-tuned, các optimizer LLM sẽ tạo sinh các chỉ dẫn Q_begin và Q_end khi text-bison làm scorer LLM

    28. n example of the meta-prompt for prompt optimization with instruction-tuned PaLM 2-L(PaLM 2-L-IT) on GSM8K, where the generated instruction will be prepended to the beginningof “A:” in the scorer LLM output (A_begin in Section 4.1). <INS> denotes the position where thegenerated instruction will be added. The blue text contains solution-score pairs; the purple textdescribes the optimization task and output format; the orange text are meta-instructions

      Ví dụ về meta-prompt cho việc tối ưu prompt được sử dụng để giải bài toán GSM8K, trong đó chỉ dẫn được tạo sinh sẽ được gán vào đầu của phần A. <INT> thể hiện vị trí mà chỉ dẫn được thêm vào. Phần màu xanh dương chứa các cặp giải pháp-điểm, phần màu tím mô tả bài toán tối ưu và bố cục của đầu ra, phần màu cam là các meta-instruction

    29. Q_begin: the instruction is added before the original question.• Q_end: the instruction is added after the original question.• A_begin: the instruction is added to the beginning of the scorer LLM output. This is applicableto pretrained LLMs without instruction tuning, where the prompt is formatted as a sequence ofQA pairs.

      Các vị trí được dùng để gán chỉ dẫn: - Q_begin: chỉ dẫn được thêm vào trước câu hỏi gốc. - Q_end: chỉ dẫn được thêm vào sau câu hỏi gốc. - A_begin: chỉ dẫn được thêm vào phần đầu của đầu ra scorer LLM. Nó có thể được áp dụng cho các pretrained LLM mà không cần fine-tune, trong đó chỉ dẫn được bố cục thành 1 chuỗi QA.

    30. We denote the LLM for objective function evaluation as the scorer LLM, and the LLMfor optimization as the optimizer LLM.The output of the optimizer LLM is an instruction, which is concatenated to the question part of everyexemplar and prompts the scorer LLM. We consider the following positions to insert the instruction:

      LLM cho việc đánh giá hàm mục tiêu là scorer LLM, và LLM cho việc tối ưu hóa là optimizer LLM. Đầu ra của optimizer LLM là một chỉ dẫn, được nối với phần câu hỏi của tất cả các ví dụ và dùng để chỉ dẫn cho scorer LLM.

    31. We prompt the meta-prompt 8times to generate at most 8 new (w, b) pairs in each step to improve optimization stability. Then weevaluate the objective value of the proposed pair and add it to history. We do black-box optimization:the analytic form does not appear in the meta-prompt text. This is because the LLM can oftencalculate the solution directly from the analytic form

      meta-prompt được thực hiện 8 lần để sinh ra tất cả 8 cặp (w, b) mới ở mỗi bước để cải thiện tính ổn định trong tối ưu, sau đó các cặp này sẽ được đánh giá giá trị mục tiêu và thêm vào meta-prompt. Việc tối ưu được thực hiện kiểu "hộp đen": Các mẫu phân tích sẽ không xuất hiện trong văn bản meta-prompt. Đó là bởi LLM có thể thường tính toán giải pháp trực tiếp từ mẫu phân tích.

    32. In each step, we prompt an instruction-tuned LLM with a meta-prompt that includes the best 20 (w, b) pairs in history and their sortedobjective values. The meta-prompt then asks for a new (w, b) pair that further decreases the objectivevalue

      Ở mỗi bước tối ưu, instruction-tuned LLM được chỉ dẫn với meta-prompt bao gồm 20 cặp (w,b) tốt nhất và giá trị mục tiêu (MSE loss) tương ứng với từng cặp. Meta-prompt sau đó yêu cầu 1 cặp (w,b) có thể làm giảm hơn nữa giá trị của hàm đánh giá.

    33. We study the setting in which the independentand dependent variables X and y are both one-dimensional and an intercept b is present, so thatthere are two one-dimensional variables w, b to optimize over. In a synthetic setting, we sampleground truth values for one-dimensional variables wtrue and btrue, and generate 50 data points byy = wtruex + btrue + ε, in which x ranges from 1 to 50 and ε is the standard Gaussian noise.

      Cài đặt của bài toán Linear Regression: - Biến phụ thuộc X và biến độc lập y đều là các giá trị 1 chiều, sao cho có 2 biến 1 chiều là w và b được tối ưu. - Các giá trị ground-truth với 1 cặp giá trị w_true và b_true sẽ được lấy mẫu với với số lượng 50. Công thức y = w_true*X + b_true + \(ε\), trong đó X nằm trong khoảng 1 đến 50 và ε là nhiều Gaussian

    34. t the solution generation step, the LLM generates new solutions with the meta-prompt as input. Thefollowing are the key optimization challenges we address in this stage.Optimization stability. In the optimization process, not all solutions achieve high scores andmonotonically improve over prior ones. Due to the sensitivity of in-context learning to the prompt,LLM output can be drastically affected by low-quality solutions in the input optimization trajectory,especially at the beginning when the solution space has not been adequately explored. This sometimesresults in optimization instability and large variance. To improve stability, we prompt the LLM togenerate multiple solutions at each optimization step, allowing the LLM to simultaneously exploremultiple possibilities and quickly discover promising directions to move forward.Exploration-exploitation trade-off. We tune the LLM sampling temperature to balance betweenexploration and exploitation. A lower temperature encourages the LLM to exploit the solution spacearound the previously found solutions and make small adaptations, while a high temperature allowsthe LLM to more aggressively explore solutions that can be notably differen

      Ở bước tạo sinh giải pháp, LLM tạo các giải pháp mới với meta-prompt là đầu vào. Có một số thách thức trong việc tối ưu được giải quyết ở bước này: - Độ ổn định trong tối ưu: Trong quá trình tối ưu, không phái tất cả các giải pháp đều đạt được kết quả cao và luôn có kết quả tốt hơn giải pháp trước. Do sự nhạy cảm của in-context learning đối với prompt, đầu ra của LLM có thể bị ảnh hưởng đáng kể bởi các giải pháp có kết quả thấp có trong tối ưu lân cận nằm trong đầu vào, đặc biệt là ở lúc đầu khi tập giải pháp chưa đủ lớn. Điều này đôi khi dẫn đến sự không ổn định trong tối ưu là phương sai lớn. Để cải thiện tính ổn định, LLM được chỉ dẫn để tạo sinh nhiều giải pháp khác nhau ở mỗi bước tối ưu, cho phép LLM có thể đổng thời khám phá nhiều khả năng và phát hiện nhanh chóng các hướng đi tiềm năng để tiếp tục đào sâu.

      • Đánh đổi exploration-exploitation: chỉ số temperature của LLM được tinh chỉnh để cân bằng giữa việc exploration và exploitation. Giá trị temperature thấp khuyến khích LLM đào sâu xung quanh các giải pháp trước đó và có ít sự thích nghi, trong khi điểm temperature cao cho phép LLM khám phá các giải pháp có tính khác biệt cao.
    35. Optimization trajectory. Besides understanding natural language instructions, LLMs are alsoshown to be able to recognize patterns from in-context demonstrations (Wei et al., 2023; Madaan &Yazdanbakhsh, 2022; Mirchandani et al., 2023). Our meta-prompt makes use of this property and in-structs the LLM to leverage the optimization trajectory for generating new solutions. Specifically, theoptimization trajectory includes past solutions and their optimization scores, sorted in the ascendingorder. Including optimization trajectory in the meta-prompt allows the LLM to identify similarities ofsolutions with high scores, encouraging the LLM to build upon existing good solutions to constructpotentially better ones without the need of explicitly defining how the solution should be updated.
      • Tối ưu lân cận: Bên cạnh việc hiểu các chỉ dẫn, các LLM cũng được chứng mình là có thể nhận ra các điểm nổi bật từ các thể hiện in-context. Meta-prompt tận dụng đặc điểm này và hướng dẫn LLM tận dụng tối ưu lận cận cho việc tạo sinh các giải pháp mới. Cụ thể, tối ưu lận cận chứa các giải pháp trước đó và điểm số tương ứng của từng giải pháp (được sắp xếp theo thứ tự tăng dần). Việc bao gồm tối ưu lân cận cho phép LM xác định tính tương đồng của các giải pháp với mức điểm cao, từ đó khuyến khích LLM xây dựng dựa trên các giải pháp tốt đã có dể tạo ra các giải pháp tốt hơn mà khồng cần phải xác định một cách tường minh giải pháp nào nên được cập nhật.
    36. Optimization problem description. The first part is the text description of the optimization problem,including the objective function and solution constraints. For example, for prompt optimization,the LLM can be instructed to “generate a new instruction that achieves a higher accuracy”, and wedenote such instructions in the meta-prompt as meta-instructions. We can also provide customized

      2 phần quan trọng của meta-prompts: - Mô tả bài toán tối ưu: Phần đầu tiên là mô tả bằng văn bản của bài toán tối ưu, bao gồm hàm mục tiêu và ràng buộc giải pháp. Ví dụ, đối với việc tối ưu hóa prompt, LLM có thể được hướng dẫn để "tạo sinh ra 1 chỉ dẫn mới giúp đạt được điểm accuracy cao hơn". và các chỉ dẫn như vậy trong các meta-prompt được gọi là meta-instructions. Các meta-instruction tùy chỉnh cũng được cung cấp như một cách điều chỉnh không chính thức của các giải pháp được tạo sinh, ví dụ như "chỉ dẫn nên xúc tích và có thể áp dụng một cách tổng quát"

    37. illustrates the overall framework of OPRO. In each optimization step, the LLM generatescandidate solutions to the optimization task based on the optimization problem description andpreviously evaluated solutions in the meta-prompt. Then the new solutions are evaluated and added tothe meta-prompt for the subsequent optimization process. The optimization process terminates whenthe LLM is unable to propose new solutions with better optimization scores, or a maximum numberof optimization steps has reached

      Kiến trúc tổng thể của OPRO. Ở mỗi bước tối ưu, LLM sẽ đưa ra các giải pháp tiềm năng cho bài toán tối ưu dựa trên mô tả bài toán tối ưu hóa và các prompt đã được đánh giá từ trước trong meta-prompt. Sau đó các giải pháp mới sẽ được đánh giá và đưa vào meta-prompt cho quá trình tối ưu kế tiếp. Qúa trình tối ưu kết thúc khi LLM không thể đưa ra các giải pháp mới với điểm tối ưu cao hơn hoặc số bước tối ưu chạm ngưỡng.

    38. eachoptimization step in our work generates new prompts that aim to increase the test accuracy based ona trajectory of previously generated prompts, instead of editing one input prompt according to naturallanguage feedback (Pryzant et al., 2023) or requiring the new prompt to follow the same semanticmeaning (Zhou et al., 2022b)

      Khác với các nghiên cứu gần đây sử dụng LLM cho việc sinh prompt tự động, mỗi bước tối ưu hóa sẽ tạo sinh các prompt mới có mục tiêu tăng điểm accuracy dựa trên lân cận của các prompt đã được tạo sinh trước đó, thay vì chỉnh sửa một prompt đầu vào dựa trên phản hồi ngôn ngữ tự nhiên hoặc yêu cầu prompt mới phải có ý nghĩa ngữ cảnh tương tự.

    39. The meta-prompt contains two core pieces of information. The first piece ispreviously generated prompts with their corresponding training accuracies. The second piece is theoptimization problem description, which includes several exemplars randomly selected from thetraining set to exemplify the task of interest

      Meta-prompt (prompt dùng cho LLM để làm trình tối ưu) có 2 phần thông tin chính. - Thông tin chính đầu tiên là các prompt đã được tạo sinh từ trước cùng với điểm accuracy tương ứng. - Thông tin chính thứ 2 là mô tả bài toán tối ưu hóa chứa một vài mẫu ví dụ được lấy ngẫu nhiên từ tập huấn luyện để minh họa cho bài toán.

    40. wever, the large and discrete prompt space makes itchallenging for optimization, especially when only API access to the LLM is available. Followingprior work on continuous and discrete prompt optimization (Lester et al., 2021; Li & Liang, 2021;Zhou et al., 2022b; Pryzant et al., 2023), we assume a training set is available to compute the trainingaccuracy as the objective value for optimizatio

      Tiếp nối các công trình trước đó nghiên cứu bài toán tối ưu prompt liên tục và rời rạc, nhóm nghiên cứu quy ước rằng một tập huấn luyện là có sẵn để tính toán điểm accuracy trên tập train như một giá trị mục tiêu cho bài toán tối ưu hóa, và kết quả thực nghiệm cho thấy việc tối ưu hóa prompt dựa trên điểm accuracy trên 1 tập huấn luyện nhỏ là đủ để đạt được kết quả cao trên tập test.

    41. the optimal prompt formats can be model-specific and task-specific (Ma et al., 2023;Chen et al., 2023c). Therefore, prompt engineering is often important for LLMs to achieve goodperformance (Reynolds & McDonell, 2021).

      các bố cục prompt tối ưu có thể được cụ thể hóa dựa trên mô hình và bài toán. Vì vậy, prompt engineering thường quan trọng với LLM để đạt được hiệu quả tốt nhất.

    42. Specifically, we focus on natural language tasks where both the taskinput and output are texts. LLMs are shown to be sensitive to the prompt format

      Các bài toán được tập trung đánh giá liên quan đến ngôn ngữ tự nhiên mà trong đó cả đầu vào và đầu ra đều là văn bản. LLM được chứng minh là nhạy cảm với bố cục của prompt

    43. Their ability to understand natural language lays out a new possibility for optimization: instead offormally defining the optimization problem and deriving the update step with a programmed solver,we describe the optimization problem in natural language, then instruct the LLM to iteratively generatenew solutions based on the problem description and the previously found solutions. Optimizationwith LLMs enables quick adaptation to different tasks by changing the problem description in theprompt, and the optimization process can be customized by adding instructions to specify the desiredproperties of the solutions.

      Khả năng của LLM trong việc hiểu ngôn ngữ tự nhiên đã đặt ra một khả năng mới cho bài toán tối ưu hóa: thay vì phải xác định bài toán tối ưu hóa và thu được bước cập nhật cùng với một phần mềm, bài toán tối ưu hóa được mô tả bằng ngôn ngữ tự nhiên, sau đó hướng dẫn LLM tạo sinh các giải pháp mới một cách lặp lại dựa trên mô tả của bài toán và các giải pháp trước đó. Việc tối ưu bằng LLM cho phép việc thích nghi nhanh với các bài toán khác nhau bằng cách thay đổi mô tả bài toán trong prompt, và quá trình tối ưu có thể được tùy chỉnh bằng việc thêm các chỉ dẫn để cụ thể hóa các tính chất cần có của các giải pháp.

    44. We first showcaseOPRO on linear regression and traveling salesman problems, then move on to ourmain application in prompt optimization, where the goal is to find instructionsthat maximize the task accuracy

      Phương pháp OPRO được thử nghiệm với bài toán hồi quy tuyến tính (linear regression) và bái toán người giao hàng (traveling salesman), sau đó được đánh giá trên bài toán chính trong việc tối ưu hóa prompt mà trong đó, mục tiêu là tìm các prompt giúp tối đa hóa điểm accuracy.

    45. In this work, we propose Optimization by PROmpting(OPRO), a simple and effective approach to leverage large language models (LLMs)as optimizers, where the optimization task is described in natural language. Ineach optimization step, the LLM generates new solutions from the prompt thatcontains previously generated solutions with their values

      Bài báo đề xuất phương pháp OPRO, một phương pháp đơn giản và hiệu quả tận dụng LLM làm trình tối ưu, trong đó bài toán tối ưu được mô tả dưới dạng ngôn ngữ tự nhiên. Ở mỗi bước tối ưu, LLM sẽ tạo ra các giải pháp mới từ prompt chứa các giải pháp được tạo trước đó với các giá trị của chúng, sau đó các giải pháp mới sẽ được đánh giá và thêm vào prompt cho bước tối ưu tiếp theo.

  6. Nov 2024
    1. In the decoding phase, we employ a greedy spansection (Zaratiana et al., 2022) that selects en-tity spans based on matching scores, to ensuretask/dataset specific constraints. This strategy is ap-plied independently to each sentence. Only, spans(i, j) with matching scores φ(i, j, c) > 0.5 are con-sidered for selection.Flat NER: The algorithm chooses the highest-scoring non-overlapping span and continues thisprocess until all spans are evaluated.Nested NER: Similar to Flat NER, but the algo-rithm allows selection of fully nested spans withinother entities while still avoiding partial overlaps.Algorithm Efficiency: The decoding is imple-mented using a priority queue for spans, ensuringan O(n log n) complexity, with n being the numberof candidate spans.

      giải thuật decode: sử dụng thuật toán tham lam theo đoạn, sẽ chọn các đoạn phù hợp dựa trên các điểm. Các đoạn có điểm > 0.5 sẽ được coi là đúng. Có 3 giải thuật decode:

      • Flat NER: giải thuật này chọn đoạn không chồng chéo có điểm cao nhất và tiếp tục như vaatyj đến khi nào tất cả các đoạn đều được chọn.
      • Nested NER: tương tự NestNER, nhưng cho phép chọn các đoạn được đóng gói toàn bộ trong các thực thể khác mà vẫn tránh được bị chồng chéo 1 phần.
      • Hiệu quả thuật toán: Chiến lược decode được cài đặt sử dụng hàng đợi ưu tiên cho các đoạn, đảm bảo độ phức tạp là O(n log n) với n là số lượng đoạn ứng viên.
    2. our objective is to optimize modelparameters to enhance the matching score for cor-rect span-type pairs (positive pairs) and reduce itfor incorrect pairs (negative pairs). A span (i, j)paired with an entity type t forms a positive pair(s ∈ P) if the span is labeled with type t in the train-ing data. Otherwise, it is a negative pair (s ∈ N ).The training loss for an individual example, com-prising spans S and entity types T , is defined as:LBCE = − ∑s∈S×TIs∈P log φ(s)+Is∈N log (1 − φ(s))(3)The variable s represents a pair of span/entitytype and I is an indicator function, which returns1 when the specified condition is true and 0 oth-erwise. This loss function corresponds to binarycross-entropy

      Mục tiêu của quá trình huấn luyện là cải thiện điểm phù hợp của các cặp đoạn-nhãn đúng và giảm thiểu điểm của các cặp sai. Hàm mất mát được sử dụng ở mỗi mẫu dữ liệu, bao gồm 1 các đoạn S và các nhãn T, được định nghĩa như sau:....

      biến s tượng trưng cho cặp đoạn-nhãn

    3. To evaluatewhether a span (i, j) corresponds to entity type t,we calculate the following matching score:φ(i, j, t) = σ(STij qt) ∈ R (2)In this equation, σ denotes a sigmoid activationfunction. As we train with binary cross-entropyloss (see next sec. 2.2), φ(i, j, t) can be interpretedas the probability of the span (i, j) being of type t.

      Để đánh giá xem đoạn từ i đến j có ứng với nhãn thực thể t hay không, điểm phù hợp sẽ được tính như sau: ......

    4. The computation of all span represen-tations can be easily parallelized. Moreover, we setan upper bound to the length (K=12) of the span inorder to keep linear complexity, without harmingrecall.

      Trên thực tế, việc tính toán của tất cả các đoạn đều có thể được song song hóa. Giới hạn độ dài của đoạn là 12 để đảm bảo độ phức tạp tuyến tính.

    5. he entity representa-tion is computed by refining the initial represen-tation p using a two-layer feedforward network,resulting in q = {qi}M −10 ∈ RM ×D. The repre-sentation of a span starting at position i and endingat position j in the input text, Sij ∈ RD, is com-puted as:Sij = FFN(hi ⊗ hj ) (1)Here, FFN denotes a two-layer feedforward net-work, and ⊗ represents the concatenation operation.

      Thể hiện của thực thể được tính bằng cách tinh chỉnh thể hiện ban đầu p thành thể hiện q thông qua một mạng gồm 2 lớp feed-forward. Thể hiện của 1 đoạn văn bản xuất phát từ vị trí i và kế thúc tại j, gọi là Sij, được tính như sau:

      Sij = FFN(hi.. hj)

      Với FFN là mang gồm 2 lớp feed-forward và .. là phép nối 2 vector.(Sị in R^D)

    6. h = {hi}N −10 ∈ RN ×D denotes the representationof each word in the input text. For words tokenizedinto multiple subwords, we use the representationof the first subword, which is a standard choice inthe NER literature

      h là thể hiện của các từ có trong văn bản đầu vào. Với các từ được chia thành nhiều subword, thể hiện của subword đầu tiên sẽ được sử dụng để thể hiện từ đó.

    7. Let p = {pi}M −10 ∈ RM ×D represent the en-coder’s output for each entity type, correspondingto all the [ENT] token representation

      p = {p_i}0->(M-1) in R^{M x D}thể hiện đầu ra của encoder với mỗi nhãn thực thể, tương ứng với thể hiện của các token [ENT]

    8. put format The input to our model comprises aunified sequence combining entity types (expressedin natural language) and the input text from whichentities are to be extracted. The input format is asfollows:Human: What describes organization in the text ?Assistant: [‘Mcgill University’]Bidirectional LMs(BERT, DeBERTa)(0,1, person)(4,5, organization)[ENT] person [ENT] location [ENT] organization [SEP]+Alain Farley works at McGill Universitya) UniNER (prev) : Prompting LLM for Open NER.b) GLiNER (Ours): Prompting BiLM for Open NER.[ENT] [ENT] ... [ENT] [SEP] ...t0 t1 tM−1 x0 x2 xN−1[ENT] token represents a special token placedbefore each entity type and the [SEP] token func-tions as a delimiter, separating the sequence of en-tity types from the input text. They are initializedrandomly at the start of training

      Dạng đầu vào bao gồm 2 chuỗi được nối lần lượt với nhau bằng token [SEP] là chuỗi thực thể và chuỗi văn bản. Chuỗi thực thể gồm tên các thực thể, vơi mỗi tên thực thể đều có token [ENT] đứng liền trước nó.

    9. Our model has threemain components: i) a pre-trained textual encoder(a BiLM such as BERT), ii) a span representationmodule which computes span embeddings from to-ken embeddings, iii) an entity representation mod-

      Mô hình gồm 3 thành phần chính: - Một bộ encode văn bản (BiLM như BERT) - một module thể hiện đoạn văn bản, có chức năng tính toán các embedding văn bản từ embedding của các token. - Một module thể hiện thực thể, có chức nằng tính các embedding của thực thể mà mô hình cần trích xuất ra.

      Mục tiêu là có được thể hiện thực thể va thể hiện văn bản ở trong cùng 1 không gian ẩn để đạt được tính phù hợp trong việc bắt cặp.

    10. turally solves the scalabilityissues of autoregressive models and allows for bidi-rectional context processing, which enables richerrepresentations

      Hướng tiếp cận này giải quyết vấn đề mở rộng quy mô của các mô hình LLMS và cho phép việc xử lý ngữ cảnh song hướng, cho phép có nhiều thông tin ngữ cảnh hơn,

    11. n our work, we propose a model that addressesthe above-mentioned problems. Instead of relyingon large autoregressive models, we utilize smaller-scale Bidirectional Language Models (BiLM), suchas BERT (Devlin et al., 2019) or deBERTa (Heet al., 2021). The core concept of our model in-volves treating the task of Open NER as matchingentity type embeddings to textual span represen-tations in latent spac

      Trong bài báo này, mô hình ngôn ngữ song hướng (BiLM) được sử dụng. Bài toán NER điwọc coi như giống với việc ghép cặp vector embedding của 1 thực thể với thể hiện của văn bản trong không gian ẩn.

    12. While these works have achievedremarkable results, they present certain limitationswe seek to address: They use autoregressive lan-guage models, which can be slow due to token-by-token generation; Moreover, they employ largemodels with several billion parameters, limitingtheir deployment in compute-limited scenarios.Furthurmore, as NER is treated as a text gener-ation problem, the generation of entities is donein several decoding steps, and there is no way toperform the prediction of multiple entity types inparalle

      Trong khi hướng tiếp cận fine-tune open-source llm cho bài toan NER có đạt được một số bước tiến đáng kể, nó vãn tồn tại một số hạn chế: - Các mô hình này sử dụng cơ chế tạo sinh tự động hồi quy (autoregressive), vì vậy có thể rất chậm do việc tạo sinh tuần từ từng token. - Các mô hình này có kích thước hàng tỉ tham số, hạn chế khả năng được triển khai trong các trường hợp ít tài nguyên. - Khi bài toán NER được xử lý tượng tự 1 bài toán tạo sinh văn bản, việc tạo sinh các entity sẽ hoàn thành sau các bước decoding. và sẽ không có cách để thực hiện việc dự đoán nhiều thực thể khác nhau 1 cách song song.

    13. powerfulLLMs typically consist of billions of parametersand thus require substantial computing resources.Although it is possible to access some LLMs viaAPIs (OpenAI, 2023), using them at scale can incurhigh cost

      các mô hình llm mạnh yêu cầu tài nguyên tính toán lớn. Mặc dù có thể truy cập vào các LLM này thông qua API, ví dụ như openAI, việc sử dụng chúng ở một quy mô nhất định sẽ dấn đến phát sinh chi phí lớn.

    14. Traditional NER models arelimited to a predefined set of entity types. Expand-ing the number of entity types can be beneficial formany applications but may involve labeling addi-tional datasets

      Các mô hình NER truyền thống bị giới hạn với tập nhãn được xác định từ trước. Việc mở rộng số lượng nhãn có thể là rất có lợi, nhưng sẽ yêu cầu quá trình gán nhãn bổ sung.

    15. veraging a bidirectional transformer en-coder, our model, GLiNER, facilitates parallelentity extraction, an advantage over the slowsequential token generation of LLMs. Throughcomprehensive testing, GLiNER demonstratestrong performance, outperforming both Chat-GPT and fine-tuned LLMs in zero-shot evalua-tions on various NER benchmarks

      Tận dụng khả năng trích xuất thực thể song song - 1 lợi thế so với việc tạo sinh tuần tự của LLM, GLiNER đã chứng minh là có kết quả tốt hơn so với ChatGPT và các LLM được fine-tune trong việc infer zero-shot.

  7. Oct 2024
    1. Data construction prompt. Fig. 6 shows theprompt used for Chinese distillation data construc-tion. We follow Zhou et al. (2024) to design theprompt for Chinese data construction. We adoptthe data construction prompt of Pile-NER-type 3,since it shows the best performance as in (Zhouet al., 2024).Figure 6: Data construction prompt for Chinese opendomain NER.Data processing. Following (Zhou et al., 2024),we chunk the passages sampled from the Sky cor-pus4 to texts of a max length of 256 tokens andrandomly sample 50K passages. Due to limitedcomputation resources, we sample the first twentyfiles in Sky corpus for data construction, since thesize of the entire Sky corpus is beyond the pro-cessing capability of our machines. We conductthe same data processing procedures including out-put filtering and negative sampling as in UniNER.Specifically, the negative sampling strategy for en-tity types, is applied with a probability proportionalto the frequency of entity types in the entire con

      Qúa trình xây dựng dữ liệu Sky-NER (Open NER tiếng Trung): - Xây dựng prompt: Dựa trên chiến lược của bài UniversalNER. - Xử lý dữ liệu: Thu thập dữ liệu bằng cách cắt đoạn văn trong sky-scorpus thành các đoạn văn bản có độ dài tối đa là 256 token và chọn ra ngẫu nhiên 50K đoạn văn.

    2. ference with out-domain examples. Duringinference, since examples from the automaticallyconstructed data is not aligned with the domainsand schemas of the human-annotated benchmarks,we refer to them as out-domain examples. Fig. 4shows the results of inference with out-domain ex-amples using diverse retrieval strategies. We usethe model trained with NN strategy here. After ap-plying example filtering such as BM25 scoring, in-ference with out-domain examples shows improve-ments compared to the baseline, suggesting theneed of example filtering when implementing RAGwith out-domain examples

      Qúa trình infer với các mẫu out-domain: Trong quá trình infer, bởi vì các mẫu từ tập dữ liệu xây dựng tự động có domain và format không giống với dữ liệu được gán nhãn bởi con người, các mẫu này sẽ được gọi là out-domain.

      Trong thực nghiệm ở hình 4, mô hình RA-IT được huấn luyện với chiến lược truy xuất NN. Sau khi áp dụng bộ lọc BM25, việc infer với các mẫu out-domain cho thấy cải thiện so với baseline, từ đó cho thấy tầm quan trọng trong việc thêm bộ lọc khi áp dụng RAG với các mẫu out-domain.

    3. Training with diverse retrieval strategies. Fig.3 visualize the results of training with various re-trieval strategies. We conduct inference with andwithout examples for each strategy, and set the re-trieval strategy of inference the same as of training.The most straight forward method NN shows bestperformances, suggesting the benefits of semanti-cally similar examples. Random strategy, though in-Figure 4: Impacts of inferece with out-domain examplesusing various retrieval strategies. The average F1 valueof the evaluated benchmarks are reported. w/o exmp.means inference without example. Applying examplefiltering strategy such as BM25 filtering benefits RAGwith out-domain examples.Figure 5: Impacts of inference with in-domain examples.The average F1 value of the evaluated benchmarks arereported. N -exmp. means the example pool of size N .Sufficient in-domain examples are helpful for RAG.ferior to NN, also shows improvements, indicatingthat random examples might introduce some gen-eral information of NER taks to the model. Mean-while, inference with examples does not guaranteeimprovements and often hurt performances. Thismay due to the differences of the annotation schemabetween the automatically constructed data and thehuman-annotated benchmarks

      Huấn luyện với các chiến lược truy xuất khác nhau: Được thể hiện ở hình 3. Qúa trình infer được tiến hành có hoặc không có các mẫu tham khảo với mỗi chiến lược trích xuất, và chiến lược trích xuất trong cả quá trình huấn luyện và quá trình infer là giống nhau.

      Kết quả cho thấy NN là chiến lược truy xuất tốt nhất, từ đó cho thấy tầm quan trọng của các mẫu tham khảo có sự tương đồng về mặt ngữ nghĩa. Trong khi đó, việc infer với các ví dụ thì không đảm bảo sự tăng tiến và thường ảnh hưởng tiêu cực đến kết quả.

    4. Diverse retrieval strategies. The followingstrategies are explored in the subsequent analysis.(1) Nearest neighbor (NN), the strategy used in themain experiments, retrieves k nearest neighborsof the current sample. (2) Nearest neighbor withBM25 filter (NN, BM), where we apply BM25 scor-ing to filters out NN examples not passing a prede-fined threshold. Samples with no satisfied exam-ples are used with the vanilla instruction template.(3) Diverse nearest neighbor (DNN), retrieves Knearest neighbors with K >> k and randomly se-lects k examples from them. (4) Diverse nearestwith BM25 filter (DNN,BM), filters out DNN exam-ples not reaching the BM25 threshold. (5) Random,uniformly selects k random examples. (6) Mixednearest neighbors (MixedNN), mixes the using ofthe NN and random retrieval strategies with theratio of NN set to a.

      Các chiến lược truy xuất chính: - Nearest neighbor (NN): Chiến lược được sử dụng trong các thực nghiệm chính, có khả năng trích xuất ra k mẫu gần với mẫu cần truy xuất nhất. - NN với bộ lọc BM25 (NN, BM): bộ lọc BM25 được sử dụng để lọc các mẫu NN có độ tương đồng ko vượt qua 1 ngưỡng nhất định - NN đa dạng: truy xuất K mẫu NN với K >> k, sau đó chọn ngẫu nhiên k mẫu trong K mẫu NN trên. - Random - NN hỗn hợp:Sử dụng kết hợp NN và các chiến lược chọn ngẫu nhiên với tỉ lệ chọn của NN là alpha

    5. We explore the impacts of diverse retrieval strate-gies. We conduct analysis on 5K data size for costsaving as the effect of RA-IT is consistent acrossvarious data sizes as shown in Section 3.4. Wereport the average results of the evaluated bench-marks here

      Phân tích: Phân tích này được thực hiện để khám phá mức độ ảnh hưởng của các chiến lược truy xuất khác nhau. Phân tích được tiến hành với mẫu dữ liệu có kích thước 5K.

    6. The main results are summarized in Table 1 and2 respectively. We report the results of inferencewithout examples for RA-IT here, since we foundthis setting exhibits more consistent improvements.The impacts of inference with examples are studiedin Section 3.5. As shown in the tables, RA-ITshows consistent improvements on English andChinese across various data sizes. This presumablybecause the retrieved context enhance the model

      Kết quả chính: Được thể hiện ở bảng 1 và bảng 2. Chú ý rằng, thực nghiệm trong 2 bảng này đã thực hiện quá trình infer mà không có few-shot, lý do bởi việc infer này đem lại sự tăng tiến bền vững trong kết quả.

      Kết quả cho thấy RA-IT đạt kết quả tốt nhất. Lý do cho sự tăng tiến này được cho là nhờ ngữ cảnh được truy xuất đã làm tăng cường khả năng hiểu đầu vào của mô hình, từ đó thể hiện sự cần thiết của các mẫu instruction có tăng cường ngữ cảnh.

    7. We conduct a preliminary study on IT data effi-ciency in targeted distillation for open NER byexploring the impact of varous datas sizes: [0.5K,1K, 5K, 10K, 20K, 30K, 40K, 50K]. We use vanillaIT for preliminary study. Results are visualized inFig. 2. The following observations are consistentin English and Chinese: (1) a small data size al-ready surpass ChatGPT’s performances. (2) Perfor-mances are improving as the data sizes increased to10K or 20K, but begin to decline and then remainat a certain level as data sizes further increased to50K. Recent work for IT data selection, Xia et al.Figure 2: Preliminary study of IT data efficiency foropen NER in English (left) and Chinese (right) scenar-ios, where the training data are Pile-NER and Sky-NERrespectively. Average zero-shot results of evaluatedbenchmarks are illustrated. The performance does notnecessarily improve as the data increases.(2024); Ge et al. (2024); Du et al. (2023) also findthe superior performances of only limited data size.We leave selecting more beneficial IT data for IEas future work. Accordingly, we conduct mainexperiments on 5K, 10K and 50K data sizes

      Nghiên cứu chuẩn bị cho đánh giá hiệu quả của dữ liệu: Nghiên cứu chuẩn bị được tiến hành cho việc đánh giá hiệu quả của bộ dữ liệu IT trong việc chiết xuất có mục tiêu của bài toán open NER bằng cách khám phá mức độ ảnh hưởng của dữ liệu ở nhiều kích thước khác nhau: [0.5K, 1K, 5K,...]. Mẫu IT đơn thuần được sử dụng để thực hiện nghiên cứu này.

      Các kết luận rút ra: - Một lượng nhỏ dữ liệu đã có thể vượt qua được khả năng của chatGPT. - Kết quả có sự tăng tiến thuận theo độ tăng của kích thước mô hình (từ 10K lên 20K), nhưng bắt đầu giảm và ổn định ở một mức cụ thể khi dữ liệu tiếp tục tăng đến mức 50k. Các nghiên cứu gần đây về việc chọn dữ liệu IT cũng cho ra kết quả việc trội của bộ dữ liệu nhỏ có kích thước hạn chế.

    8. Training data: For English, we use thetraining data Pile-NER released by Zhou et al.(2024). For Chinese, we use the training data Sky-NER constructed in this paper as described in Sec-tion 3.2. We use LoRA (Hu et al., 2021) to trainmodels. Retrieval: We adopt GTE-large2 (Liet al., 2023) to generate text embeddings and setk = 2 in main experiments. Evaluation: Wemainly focus on the zero-shot evaluation. ForEnglish, we adopt benchmarks CrossNER, MIT-Movie and MIT-restaurant following Zhou et al.(2024). For Chinese, we collect eight benchmarksacross diverse domains, of which details are in Ap-pendix D. We report micro-F1 value

      Thực nghiệm: - Mô hình LLM: LLaMA-3-3B và Qwen-1.5.7B. - Bộ dữ liệu: Đối với tiếng Anh, bộ dữ liệu Pile-NER được sử dụng. Đối với tiếng Trung, bộ dữ liệu Sky-NER do chính nhóm tác giả xây dựng được sử dụng. LoRA được sử dụng trong quá trình huấn luyện LLM - Mô hình truy xuất: Sử dụng GTE-large để tạo ra các embedding câu và số lượng mẫu tương đồng được truy xuất là 2. - Phương pháp đánh giá: Tập trung vào đánh giá Zero-shot.

    9. Retriever. We use sentence embedding-based re-trieval and adopt cosine similarity as our similaritymetric. We retrieve the k nearest neighbors as con-text. We also investigate various retrieval strategiesfor both training and inference stages

      Truy xuất: các phương pháp truy xuất dựa trên embedding của câu được sử dụng cùng với điểm tương đồng cosine làm thước đo đánh giá. K câu tương đồng gần nhất sẽ được sử dụng làm ngữ cảnh.

    10. RA-IT. We explore an alternative way to conductIT in targeted distillation: we introduce RA-IT, acontext-enhanced tuning approach, of which theoverview is in Fig. 1. In our RA-IT approach,each data is augmented with a retrieved context,which consists of k semantically similar exam-ples retrieved from the training dataset. The re-trieved context is prepended to the original conver-sation, forming the retrieval augmented instruction.By fine tuning LMs in this recipe, we equip theLMs with the ability to generate NER answer withon-demand RAG. This means we could flexiblyadapting LMs to different scenarios by determin-ing whether to use RAG during inference based onthe specific characteristics of the scenario.

      RA-IT: Một cách khác để thực hiện instruction-tuning trong việc chiết xuất có mục tiêu, được thể hiện khái quát ở hình 1. Trong cách tiếp cận này, mỗi mẫu sẽ được tăng cường với một đoạn ngữ cảnh được truy xuất. Đoạn ngữ cảnh này bao gồm k mẫu dữ liệu tương đồng về mặt ngữ cảnh được trích xuất từ bộ dữ liệu huấn luyện. Đoạn ngữ cảnh này được thêm vào đoạn hội thoại gốc. từ đó tạo ra mẫu instruction được tăng cường truy xuất. Bằng cách tinh chỉnh các mô hình ngôn ngữ (LMs) theo hướng này, LMs sẽ được trang bị khả năng tạo sinh câu trả lời NER cùng với RAG. Điều này có nghĩa là LMs có thể được cài đặt dễ dàng để thích ứng với nhiều kịch bản khác nhau bằng cách xác định xem có cần sử udngj RAG trong quá trình infer ko dựa trên các đặc tính cụ thể của kịch bản

    11. Vanilla IT. The original instruction tuning tem-plate used in targeted distillation is shown in thebottom part of Fig. 1, which we refer to as VanillaIT, where each passage and its associated entityoutput are converted into a multi-turn conversation.

      IT đơn thuần: Mẫu instruction tuning ban đầu được sử dụng trong quá trình chiết xuất có mục tiêu được thể hiện ở bên dưới của hình 1, còn được gọi là mẫu IT đơn thuần. Trong mẫu này, mỗi câu đầu vào thô và các thực thể liên quan sẽ được hoán đổi thành một đoạn hội thoại có nhiều lượt.

    12. reliminary: Targeted Distillation. We followUniNER (Zhou et al., 2024) to conduct our studyin the setting of targeted distillation, where theysuccessfully distill the strong capability of Chat-GPT in open NER into smaller models, without anyhuman-annotated data. The pipeline is as follows:(1) Data construction. They sample inputs froma large corpus across diverse domains, then useChatGPT to automatically generate NER outputs.(2) Distillation. After obtaining the automaticallyconstructed data, they apply IT to distill the openNER capability of ChatGPT into smaller models

      Bước chuẩn bị: Chiết xuất có mục tiêu: Được làm dựa trên nghiên cứu UniNER, vốn đã thành công trong việc chiết xuất khả năng mạnh mẽ của chatGPT và truyền nó vào các mô hình nhỏ hơn mà không cần dữ liệu do con người gán nhãn. Qúa trình này bao gồm các bước: - Xây dựng dữ liệu: Các mẫu đầu vào thô được chọn từ nhiều domain đa dạng khác nhau và sử dụng chatGPT để gán nhãn. - Chiết xuất: Sau khi có được dữ liệu gán nhãn tự động, Instruction tuning được áp dụng để chiết xuất khả năng của chatGPT và truyền vào các mô hình nhỏ hơn.

    13. 1) Weempirically study the RA-IT framework for openNER. We prepare the retrieval augmented instruc-tion data with semantically similar examples. Weconduct thorough experimental analysis to studythe impact of various retrieval strategies. (2) We

      Đóng góp chính của nhóm tác giả: - Tiến hành nghiên cứu RA-IT cho bài toán open NER. Các dữ liệu tăng cường truy xuất được chuẩn bị với các mẫu tương đồng về mặt ngữ nghĩa. Các thực nghiệm được tiến hành để đánh giá mức độ ảnh hưởng của các chiến lược truy xuất. - Xây dựng bộ dữ liệu IT cho bài toán open NER bằng tiếng Trung và tiến hành thực nghiệm đánh giá với cả tiếng Anh và tiềng Trung.

    14. (1) RA-ITachieves consistent improvements on various datasizes, suggesting the need for context-enhancedfine-tuning. (2) Retrieving semantically similar ex-amples benefits the most for training among variousretrieval strategies. Random retrieval also exhibitsimprovement but shows inferior performance tosimilar examples. (3) Retrieving out-domain ex-amples for inference requires applying examplefiltering strategies to achieve improvements. Pro-viding in-domain examples benefits inference.

      Các kết luận thu được: - RA-IT đạt được độ cải thiện bền vững với dữ liệu ở nhiều phạm vi khác nhau, từ đó thể hiện sự cần thiết của việc fine-tuning với ngữ cảnh được mở rộng. - Việc truy xuất các mẫu tương đồng về mặt ngữ cảnh làm cải thiện đáng kể chất lượng huấn luyện, tùy thuộc vào chiến lược chọn mẫu trích xuất. - Việc truy xuất các mẫu out-domain trong quá trình infer yêu cầu các chiến lược lọc mẫu để đạt được hiệu quả mong muốn. Ngược lại, việc cung cấp các mẫu in-domain sẽ làm gia tăng hiệu quả của quá trình infer.

    15. our RA-IT approach, for each training sample,we retrieve semantically similar examples from thetraining dataset and prepend them to the original in-struction, forming the context-enhanced instruction.We also explore the impacts of diverse retrievalstrategies. Moreover, we construct a Chinese ITdataset for open NER and evaluate our methodin both English and Chinese scenarios. We con-duct thorough experiments across various data sizesand obtain the following key finding

      Bằng hướng tiếp cận RA-IT, đối với mỗi mẫu huấn luyện, các mẫu tương đồng về mặt ngữ nghĩa sẽ được trích xuất từ bộ dữ liệu huấn luyện và được thêm vào mẫu dữ liệu huấn luyện gốc, tạo thành mẫu huấn luyện được tăng cường ngữ cảnh. Ngoài ra , một bộ dữ liệu huấn luyện bằng tiếng Trung cho bài toán openNER cũng được xây dựng và được dùng để đánh giá hiệu quả của mô hình trên cả tiếng Anh và tiếng Trung.

    16. The previous work UniNER (Zhou et al., 2024)distills the strong capability of ChatGPT in openNER into smaller models through IT without anyhuman-annotated data. We follow this line andinvestigate RA-IT under this targeted distillationsetting. Other works of IT for IE like Sainz et al.(2024); Li et al. (2024) using code-style instructiondata, are orthogonal to this work since RA-IT canbe integrated into various instruction styles.

      UniNER đã chắt lọc khả năng mạnh mẽ của ChatGPT trong bài toán open NER và truyền các mô hình bé hơn thông qua instruction tuning mà không cần dữ liệu do con người xây dựng. Nghiên cứu này được tiến hành theo hướng tương tự và RA-IT được điều tra theo hướng chắt lọc có mục tiêu (targeted distillation)

    17. Inthis paper, we explore Retrieval AugmentedInstruction Tuning (RA-IT) for IE, focusingon the task of open named entity recognition(NER). Specifically, for each training sample,we retrieve semantically similar examples fromthe training dataset as the context and prependthem to the input of the original instruction.

      Ý tưởng chính: Sử dụng phương pháp instruction tuning có tăng cường truy hồi (RA-IT) cho bài toán IE, tập trung vào bài toán Open NER. Cụ thể, với mỗi mẫu huấn luyện, các mẫu khác có tính tương đồng về mặt ngữ nghĩa sẽ được truy xuất ra từ bộ dữ liệu và thêm các mẫu này vào đầu vào của mẫu huấn luyện ban đầu.

  8. Aug 2024
    1. n summary, our contributions are three-fold: (i)We propose a framework CLUSTERLLM that uti-lizes sentence relations predicted from API-basedLLMs to guide clustering. Furthermore, it allowsusers to provide textual instructions and/or few-shot annotations to specify preferences on cluster-ing. (ii) In order to reduce API-queries, we proposea novel entropy-based sampling strategy to find themost informative triplets. Additionally, we utilizepairwise data sampled from hierarchical cluster-ing to determine cluster granularity. (iii) Extensiveexperiments show that our proposed method canimprove clustering performance at ∼$0.2 for per-spective and ∼$0.4 for granularity with GPT-3.5.

      Tổng quan đóng góp: - Đề xuất phương pháp phân cụm CLUSTERLLM, tận dụng các mối quan hệ giữa các câu văn bản được dự đoán bởi LLM thông qua API để chỉ dẫn việc phân cụm. Hơn nữa, phương pháp này còn cho phép người dùng bổ sung thêm các chỉ dẫn ngữ cảnh hoặc 1 vài ví dụ tham khảo (đã gán nhãn) để thể hiện xu hướng mong muốn trong việc phân cụm. - Để tối ưu việc sử dụng LLM thông qua API, tác giả đề xuất chiến lược lấy mẫu dựa trên entropy để tìm ra các mẫu chứa nhiều thông tin nhất. Ngoài ra, tác giả còn tận dụng các cặp mẫu được lấy từ hệ thống phân cụm để xác định mức độ chi tiết của phân cụm.

    2. n Stage 2, we first obtain the cluster hierarchythat starts from instance-level clusters and itera-tively merge two closest clusters until the entiredataset. And then we prompt LLMs to determinecluster granularity with a few annotated data pairsas demonstrations. We construct the data pairsto prompt by sampling from two clusters that aremerged at each step of hierarchical clustering, sothat they cover a wide range of granularities. Andthe final decision is made by measuring consistencybetween each level of clustering and predictions.

      Ở bước 2, tác giả tạo ra một hệ thống phân cụm bắt đầu ở mức đơn mẫu (instance-level) và sẽ hợp nhất 2 mẫu gấn nhau nhất một cách lặp lại đến khi tại tạo lại thành dataset ban đầu. Sau đó, tác giả chỉ dẫn LLMs để nó xác định mức chi tiết của cụm với một vài cặp dữ liệu được gán nhãn làm ví dụ tham khảo. Tác giả xây dựng các cặp dữ liệu này bằng cách lấy mẫu từ 2 cụm được hợp nhất ở mỗi bước xây dựng hệ thống phân cụm. Nhờ vậy, hệ thống có thể bao quát nhiều mức độ chi tiết khác nhau. Và quyết định cuối cùng được thực hiện bằng cách tính toán sự bền vững giữa mỗi mức phân cụm và dự đoán.

    3. In Stage 1, we prompt LLMs with a triplettask that predicts which one of the two candidatechoices is closer to anchor instance to understandthe user-preferred perspectives. We choose thistriplet task because (a) it is irrelevant with clustergranularity and (b) the produced triplets can fine-tune small embedder towards the right perspective.In order to improve sample efficiency, we furtherpropose entropy-based triplet sampling to find themost informative triplets. Specifically, we first cal-culate entropy for each instance based on clusterassignment probabilities, and then identify thosewith highest entropy. Two candidate choices arethen sampled from its nearest clusters to guaranteethey are close enough to the ancho

      Ở bước 1, tác giả chỉ dẫn LLMs bằng một bài toán có 3 giá trị. LLMs có nhiệm vụ dự đoán xem trong 2 giá trị được chọn, giá trị nào giống với giá trị mỏ neo (anchor instance) hơn.

      Lý do mà bài toán này được chọn: - Nó không liên quan đến tính chi tiết của cụm văn bản - Các bộ 3 giá trị trên có thể giúp tinh chỉnh mô hình embedder giúp mô hình này phân cụm chính xác hơn.

      Để tăng hiệu quả của việc lấy các mẫu (mỗi mẫu gồm 3 giá trị), tác giả đề xuất lấy mẫu dựa trên entropy để tìm ra các mẫu chứa nhiều thông tin nhất. Cụ thể, tác giả tính entropy cho mỗi mẫu mỏ neo dựa trên xác suất gán cụm của mỗi mẫu đó, sau đó chọn ra các mẫu có điểm entropy cao nhất. Hai mẫu còn lại trong bộ 3 sau đó được chọn từ các cụm gần với mẫu mỏ neo nhất để đảm bảo 2 mẫu này đủ gần với mẫu mỏ neo.

    4. We propose CLUSTERLLM, a framework thatutilizes LLM to guide a small embedder for findingtext clusters with a low cost, as shown in Figure 1.It comprises two stages that are specially designedfor two aspects of clustering: (1) perspective, i.e.,the grouping criterion such as topic, intent and emo-tion and (2) granularity, i.e. the scope of clusters

      Tác giả đề xuất phương pháp CLUSTERLLM, 1 framework sử dụng LLM để chỉ dẫn một vector embedder nhỏ có thể tìm được cụm văn bản phù hợp với chi phí thấp. Phương pháp gồm 2 bước, được thiết kế cho 2 khía cạnh của việc phân cụm; - Các tiêu chí dùng để gom nhóm: cùng chủ đề (topic), cùng intent hoặc biểu cảm sắc thái. - Sự chi tiết: quy mô của các cụm văn bản

    5. n this paper, we provide insights on the ques-tion: Can we leverage API-based LLMs to guidetext clustering efficiently? We attack this challeng-ing question by drawing inspiration from an obser-vation that humans represent an instance throughcomparing with others

      Trong nghiên cứu này, tác giả đã đặt ra và phân tích câu hỏi sau :"Liệu có thể tận dụng LLM để chỉ dẫn việc phân cụm văn bản một cách hiệu quả". Tác giả đã giải quyết vấn đề này dựa trên quan sát: "con người thể hiện một sự vật thông qua việc so sánh nó với những sự vật khác."

    6. State-of-the-artlarge language models (LLMs) such as recent GPTseries (Brown et al., 2020; Ouyang et al., 2022;OpenAI, 2023) have demonstrated extraordinarylanguage capabilities for various NLP applicationshowever, these GPT models can only be utilizedthrough the APIs without accessible embeddingvectors for clustering. Hence, LLMs cannot bedirectly applied on text clustering tasks

      Các mô hình LLM hiện nay đều có hiệu quả cực kì tốt trên hầu hết các bài toán NLP. Tuy nhiên, các mô hình này chỉ có thể được sử dụng thông qua API mà không thể truy cập vào các vector embedding mà nó tại ra và dùng các vector này để phân cụm văn bản.

    7. ext clustering, as a fundamental task in natural lan-guage processing (NLP), has a wide spectrum ofapplications, such as identifying public perceptionfrom social media (Park et al., 2022), analysingcause of accidents (Xu et al., 2022), and detectingemerging research topics (Martínez et al., 2022). Acommon practice for text clustering is to apply clus-tering algorithms (MacQueen, 1967; Zhang et al.,∗ Corresponding author.1The cost is calculated with gpt-3.5-turbo.Texts CABTraditional Text ClusteringChatGPT(API-based)🔒ClusterLLMCABTexts CABChatGPT(API-based)🔒A should be closerto C than B🧐Not Applicable ⛔Embedder(Instructor,E5,GTR ...)Embedder(Instructor,E5,GTR ...)Figure 1: LLMs like ChatGPT are not applicable for textclustering directly because of the inaccessible embed-dings. CLUSTERLLM resolves the dilemma by leverag-ing LLM as a guide on text clustering.2021a) on top of pre-trained embedders (Muen-nighoff et al., 2022; Wang et al., 2022; Su et al.,2022) which could achieve higher performancewith better pre-training quality

      Các phương pháp phân cụm văn bản nổi tiếng hiện nay đều sử dụng các thuật toán phân cụm trên các mô hình pretrained.

    1. Due to the diversity of possibilities in human lan-guage, it is rare for the same idea to be expressedidentically in multiple documents unless one ex-pression is derived from the other, or both are quot-ing from a shared source. This observation moti-vates deduplicating exact substrings. We call ourapproach EXACTSUBSTR. When two examplesxi and xj share a sufficiently long substring (thatis, a substring for which xa..a+ki = xb..b+kj ), thatsubstring is removed from one of them. Basedon statistical analyses (§B), we select k = 50 to-kens as the minimum matching substring length.3

      Exact Substring Duplication: Khi 2 mẫu x_i và x_j chia sẻ chung 1 chuỗi con dài, chuỗi con này sẽ được loại bỏ ở 1 trong 2 mẫu trên.

    2. We introduce two complementary methodsfor performing deduplication. First, using a suf-fix array (Manber and Myers, 1993), we removeduplicate substrings from the dataset if they oc-cur verbatim in more than one example. Second,we use MinHash (Broder, 1997), an efficient algo-rithm for estimating the n-gram similarity betweenall pairs of examples in a corpus, to remove entireexamples from the dataset if they have high n-gramoverlap with any other example

      Nghiên cứu sử dụng 2 phương pháp bổ trợ cho nhau trong việc lọc trùng. Đầu tiên, một mảng hậu tố (suffix array) được sử dụng để loại bỏ các chuỗi con khỏi bộ dữ liệu nếu chúng xuất hiện trong nhiều hơn một mẫu dữ liệu. Thứ 2, Thuật toán MinHash được sử dụng để tính toán độ tương đồng n-gram giữa tất cả các cặp mẫu dữ liệu trong một bộ dữu liệu, để loại bỏ các mẫu dữ liệu có độ tương đồng n-gram lớn với bất kì mẫu dữ liệu nào khác có trong bộ dữ liệu.

    3. n our research, we do not focus on the impact ofduplicate text in pretrained models on downstreambenchmark tasks; instead we address how duplicatetext in the LM training and validation sets impactsmodel perplexity and the extent to which generatedtext included memorized content

      Nghiên cứu này đánh giá việc các văn bản trùng lặp trong tập dữ liệu huấn luyện và đánh giá của các mô hình ngôn ngữ tác động như thế nào vào điểm phức tạp (perplexity) của mô hình và mức độ mà các văn bản được tạo sinh chứa các nội dung đã được huấn luyện.

    4. GPT-3(Brown et al., 2020, §5) did the reverse and re-moved downstream evaluation examples from theirtraining data by conservatively filtering out anytrain set examples with a 13-gram overlap withany evaluation example. Up to 90% of tasks wereflagged as potentially contaminate

      GPT-3 làm ngược lại và loại bỏ các mẫu đánh giá khỏi bộ dữ liệu huấn luyện bằng cách lọc bất kì mẫu dữ liệu huấn luyện nào có độ trồng lấn 13-gram với bất kì mẫu dữ liệu đánh giá nào.

    5. Trinh and Le (2018, Appendix B) removeddocuments from their CommonCrawl-based trainset that overlapped substantially with the common-sense reasoning used for evaluatio

      Trinh và Le đã loại bỏ các tài liệu khỏi tập huấn luyện dựa trên CommonCrawl của họ các mấu dữ liệu có sự tương đồng đáng kể với các cách suy luận thường thức cho bộ dữ liệu đánh giá.

    6. ontamination of downstream tasks. Whenmodels are trained on datasets constructed by crawl-ing the Internet, it is possible the model will trainon the test set of downstream target tasks

      Khi mô hình được huấn luyện trên các bộ dữ liệu được xây dựng bằng cách lấy dữ liệu thô từ internet, có khả năng cao mô hình này cũng được huấn luyện trên bộ dữ liệu test của các bài toàn chuyên biệt.

    7. We propose two scalable techniques to detectand remove duplicated training data. Exact sub-string matching identifies verbatim strings that arerepeated. This allows us to identify cases whereonly part of a training example is duplicated (§4.1).Approximate full document matching uses hash-based techniques (Broder, 1997) to identify pairsof documents with high n-gram overlap (§4.2).

      2 kỹ thuật lọc trùng (có thể mở rộng) - Exact substring matching: xác định các chuỗi gốc được sử dụng lặp lại. Cho phép xác định các trường hợp khi mà chỉ có 1 phần của dữ liệu huấn luyện bị lặp lại. - Approximate full document matching sử dụng các kĩ thuật dạng băm (hash-based), dùng để xác định các cặp document với mức chồng lần n-gram lớn

  9. Jul 2024
    1. We run all instruction tuning experiments fromthe Hungarian pretrained model using 6 gigabytesof instruction tuning text data (2 billion tokens)and the same training settings. Each experimentis repeated 3 times with different random datasetsamples. For more details on instruction tuningdatasets or training settings see appendix C.2, C.4and D.2

      Các thử nghiệm tinh chỉnh có hướng dẫn (instruction tuning) được thực hiện từ mô hình pretrain với tiếng Hungary sử dụng 6 GB dữ liệu văn bản tinh chỉnh có hướng dẫn (2 tỉ token). Mỗi thực nghiệm được thực hiện 3 lần với các mẫu dữ liệu khác nhau được chọn ngẫu nhiên. Thực nghiệm được dùng để đánh giá tác động của số lượng các dữ liệu IT khác nhau thuộc ngôn ngữ mới đối với hiệu quả của mô hình.

    2. Given the same total amount of training data, we tested varying the percentage of English data (50%,25% and 0%) in the English/Hungarian bilingual data mixture. All training is run for 30k steps. Wealso compare this to training a pure Hungarian model using only Hungarian data [31], a Hungariantokenizer, from scratch for 100k steps. All the training details can be found in appendix D.1.

      Số lượng mẫu dữ liệu trong bộ dữ liệu huấn luyện là như nhau, tuy nhiên tỉ lệ số mẫu tiếng Anh sẽ khác nhau (0, 25% và 50%).. Số bước huấn luyện là 30k. Các cấu hình được sử dụng để tiến hành thực nghiệm: 0%, 25%, 50% Các mô hình Hungary được huấn luyện từ đầu với bộ dữ liệu tiếng Hungary, sử dụng tokenizer cho tiếng Hungary

    3. We categorize all evaluation tasks into 4 categories. Multiple Choice, for this category we appendeach candidate answer to the prompt and pick the highest probability answer. Open-ended QuestionAnswering, where we let the model generate an answer for each question, and report the averageF1 score between the model output and the ground truth. Summarization, where we let the modelgenerate a summary and report the average ROUGE-2 score between the model output and groundtruth. Translation, where we let the model generate translated text and report the BLEU scorebetween the model output and the ground truth. When we report the score for each category, it is theaveraged score of all the evaluation tasks that we classified into that category in appendix E.

      Đánh giá được thực hiện trên 4 bài toán: - Multiple choice: các câu trả lời ứng viên sẽ được nối vào chỉ dẫn và câu trả lời có xác suất cao nhất sẽ được chọn. - Trả lời câu hỏi mở: mô hình được tạo sinh câu trả lời cho mỗi câu hỏi và các câu trả lời này sẽ được tính điểm F1 so với câu trả lời ground-truth. - Tóm tắt văn bản: Mô hình được phép tạo sinh ra một bản tóm tắt và được tính điểm trung bình ROUGE-2 so với bản tóm tắt ground-truth. - Dịch máy: mô hình được phép tạo ra bản dịch và được tính điểm BLEU so với bản dịch ground-truth

    4. Training is done in a two stage pipeline. The first stage is adaptive pretraining (PT) where a basepretrained English 13B GPT-2 model (B) is continuously trained on a mixture composed of the newlanguage and English. Then, the adapted checkpoint is instruction tuned (IT) on a collection ofprompt completion pairs from the new language and English. For more information see appendixB,C

      Qúa trình huấn luyện gồm 2 giai đoạn. Giai đoạn 1 là pretrain thích nghi mà trong đó, một mô hình base cho tiếng Anh được tiếp tục huấn luyện bộ dữ liệu trộn lẫn giữa ngôn ngữ mới và tiếng Anh. Sau đó, mô hình được tinh chỉnh có hướng dẫn (instruction tune) trên một bộ các cặp chỉ đẫn từ ngôn ngữ mới và tiếng Anh.

    5. Once the datasets are prepared for both languages, we shuffle them at sample level, so that everybatch contains text from both languages during training. Note that in our experiments, we do notmake any further transformations to either the model or the datasets, after the data is preparedon each side, so that our study is orthogonal and complementary to existing proposed methods[24, 27, 28, 9, 12] focusing on training paradigm studies.

      Một khi bộ dữ liệu đã được chuẩn bị cho cả 2 ngôn ngữ it tài nguyên (tiếng Hungary và tiếng Thái), các mẫu dữ liệu sẽ được trộn lấn với nhau sao cho mọi batch huấn luyện đều chứa các mấu dữ liệu của cả 2 ngôn ngữ này.

    6. To adapt an existing tokenizer to a new language, tokens from the low resource language can beadded to the existing tokenizer’s vocabulary to improve its fertility. Fertility is defined as the averagenumber of tokens per word [22], and details about how we calculated it can be found in appendixA.1. In our work, instead of extending the tokenizer’s vocabulary, we replace the least frequenttokens from it with tokens from the new language. This way, we keep the model capability the sameby controlling the vocabulary and embedding table size. In particular, we train a BPE tokenizeron the new language with vocabulary size k and check the number of overlapping tokens o withthe original tokenizer. Then we replace the least important k − o non-overlapping tokens from theoriginal tokenizer with the new ones. We also reinitialize the corresponding embeddings in themodel. For more details see appendix A.2

      Để LLMs có thể thích nghi với các ngôn ngữ mới, các tokens từ các ngôn ngữ này có thể được thêm vào. Tuy nhiên, thay vì mở rộng bộ từ điển của mô hình, nghiên cứu sẽ thay thể một số lượng nhất định các token ít phổ biến nhất trong tập từ điển hiện tại bằng các token mới. Cách này giúp cho kích thước tập từ vựng được giữ nguyên. Cụ thể, 1 BPE encoder với một tập từ điển gồm k từ của một ngôn ngữ nhất định sẽ được huấn luyện trên 1 bộ dữ liệu của ngôn ngữ đó. Sau đó, bộ từ điển của 2 BPE encoder sẽ được so sánh với nhau với o là tập các từ có trong cả 2 bộ từ điển của 2 BPE encoder. Sau đó, các từ xuát hiện ít nhất trong BPE encoder gốc mà không có trong tập o sẽ được thay thế bởi các từ mới có trong tập k. Các embedding tương ứng với các token bị thay thế cũng được tái khởi tạo.

    7. We adapt an English-centric model to Hungarian and Thai, and our evaluations show that adding newtokens and mixing training data from both languages can retain the model’s English capabilities inaddition to improving the models ability to learn the new language. Some contemporary worksexplore similar, but far less efficient methods of training LLMs on low resource languages. [30]builds an English-Arabic bilingual LLM, but they train it from scratch; while [29] builds one forEnglish-Portuguese, but it does not optimize the tokenizer or mix the training data

      Phương pháp đề xuất: thêm token mới vào bộ từ điển của mô hình chuyên dụng cho tiếng Anh và thêm một số lượng nhất định dữ liệu hỗn hợp vào dữ liệu đơn ngữ (tiếng anh) để pretrain và fine-tune

    8. How to efficiently encode the new language? Byte Pair Encoding (BPE) [15] tokenizers are com-monly used in LLMs including GPT[16, 17], Llama [18, 19] and BLOOM [1, 2]. These tokenizersare able to encode text at the byte level so that they can generalize to characters that are outsideof their vocabulary; this means that any BPE tokenizer can be used for all languages. However,the BPE tokenizer has poor tokenization efficiency if it was not trained on a given language. Forexample, the original English-centric GPT2 tokenizer with a vocabulary size of 50k needs to use3.8 times more tokens to encode Thai compared to a smaller tokenizer with a vocabulary size of 5kthat is trained on Thai. This will inevitably cost us 3.8 times more compute in both training andinference. Furthermore, it has been shown that models with sub-optimal tokenizers can also haveworse evaluation results [20, 21]. In our work, we show how to improve tokenizer fertility[22] byreplacing the least frequent tokens in the base model with tokens from the new language.How to avoid catastrophic forgetting? Many works have shown that when continuing to train aLLM on data from a new domain, it undergoes catastrophic forgetting of the original domain it wastrained on [23], and similar issues appear when training on a new language [23, 9, 24, 2, 25, 10, 26].Different training paradigms including instruction-align[24], MAD-X [27], (IA)3 [28] are proposed

      2 câu hỏi lớn được đặt ra: - Làm sao để mã hóa hiệu quả ngôn ngữ mới: Hầu hết LLM sử dụng BPE encoder với cơ chế mã hóa dựa trên byte. Vì vậy, theo lý thuyết, bất kì loại BPE encoder nào cũng có thể mã hóa mọi ngôn ngữ. Tuy nhiên, BPE encoder sẽ mã hóa rất tệ trên các loại ngôn ngữ ít tài nguyên nếu không được huấn luyện với ngôn ngữ đó. - Làm sao để tránh được việc quên kiến thức: Nhiều nghiên cứu trước đấy chỉ ra rằng khi tiếp tục huấn luyện LLM với dữ liệu từ miền lĩnh vực mới, nó sẽ trải qua quá trình quên các dữ liệu mà nó được huấn luyện ban đầu. Vấn đề tương tụ xảy ra với việc huấn luyện với một ngôn ngữ mới. Các chiến thuật huấn luyện mơi bao gồm đính kèm chỉ dẫn , MAD-X, (IA)3 được đề xuất để giảm thiểu vấn đề này, trong khi đó phương pháp trộn lẫn bộ ngữ liệu huấn luyện từ các ngôn ngữ khác là một hướng tiếp cận được sử dụng bởi tất cả các nghiên cứu trên.

    9. Multilingual large language models have become prevalent recently [1, 2, 3, 4, 5, 6], and haveshown strong cross lingual knowledge and capability transfer [7, 8, 9, 10, 11, 12, 13]. However,these multilingual models tend to perform poorly on low-resource languages. On top of this, trainingmodels for low-resource languages from scratch is also challenging due to a lack of training data andprohibitive computational requirements. These challenges, along with the prevalence open sourcedEnglish models creates an interesting opportunity to see how they can be adapted to new languagesquickly, without wasting resources by pretraining from scratch. While prior work [9, 10, 11, 14, 13]has studied this concept, there are two important questions that warrant further investigation

      Vấn đề đặt ra: - Các mô hình đa ngôn ngữ thể hiện kém trên các ngôn ngữ ít tài nguyên. - Việc huấn luyện lại LLM từ đầu với một ngôn ngữ khác là cực kì thách thức do sự thiếu thốn của các bộ dữ liệu có sẵn và yêu cầu cao về tài nguyên tính toán.

  10. Jun 2024
    1. When agents have different targets in a task, especially when the targets are adversarial, the task can become much more complicated. An example of such a task is a zero-sum game, where the total reward is fixed, and any reward gained by one agent results in an equal loss for another agent. A specific example can be found in MPE that in scenarios like simple_push, agent ONE is trying to gain more reward by getting closer to its target location while agent TWO gains reward by pushing agent ONE away from the target location. Moreover, the competitive-like mode can also be not so pure competitive. It can incorporate some cooperative agents’ relationships. This type of work mode is referred to as mixed mode. A representative task of mixed mode is MAgent, where agents are divided into several groups. Agents in the same group need to attack the enemy group cooperatively.

      Loại bài toán đối kháng là khi các tác tử có mục tiêu trái ngược nhau.

    2. Another mode is collaborative, where agents can access individual rewards. Under this mode, the agents tend to work together, but the target varies between different agents. Sometimes individual rewards may cause some potential interest conflict. Collaborative task mode has less restriction and richer reward information for wilder algorithms development: il is a good solution for collaborative tasks, as each agent has been allocated an individual reward for doing a standard RL. Centralized Critic is a more robust algorithm family for collaborative tasks as the improved critic help agent coordinate using global information. Value Decomposition-based methods are still applicable for collaborative tasks as we can integrate all the individual rewards received into one (only the agents act simultaneously). Cooperative mode can also be transformed to collaborative as we can copy the global reward to each agent and treat them as an individual reward

      Một dạng khác là bài toán hợp tác mà trong đó, các tác tử có thể truy cập được vào phần thưởng riêng biệt của chúng.Trong bài toán này, các tác tử có xu hướng làm việc cùng nhau nhưng mục tiêu của mỗi tác tử lại có sự khác nhau.

    3. The Cooperative-like task mode is prevalent in scenarios where agents are rewarded only when the team achieves a shared goal. This mode is considered a strict form of cooperation, where each agent cannot access its individual reward. In Cooperative tasks, agents must have a robust credit assignment mechanism to decompose the global reward and update their policies accordingly.

      Trong loại bài toán hỗ trợ, mỗi tác tử không thể truy cập vào phần thưởng đơn lẻ của chúng. Vì vậy, các tác tử cần có một cơ chế phân chia phần thưởng bền vứng để có thể cập nhật chiến lược hiệu quả cho mỗi tác tử.

    4. The current state of research on multi-agent reinforcement learning (MARL) is facing challenges regarding the diversity of multi-agent tasks and the categorization of MARL algorithms. These characteristics make it difficult to conduct a fair comparison of different algorithms and raise a question for researchers: should algorithms be developed for a specific task (task first) or for general tasks (algorithm first). This difficulty stems from the nature of multi-agent tasks, as well as the various learning styles and knowledge-sharing strategies.

      Hiện nay, các bái toán của MARL phải đối mặt với vấn đề liên quan đến tính đa dạng của các bài toán đa tác tử và việc phân loại các thuật toán MARL. Các tính chất này khiến cho các nhà khoa học phải lựa chọn giữa việc phát triển thuật toán cho một bài toán cụ thể (task first) hoặc tổng quát cho tất cả các bài toán (algorithm first)

    5. Despite the simple task setting, however, the game is still very challenging as one agent needs to coordinate with another agent to achieve the highest reward: the joint action with the highest reward is not a good option from the view of the first agent if it is not willing to cooperate with another agent. Two-step Game evaluates whether an agent has learned to cooperate by sacrificing its reward for a higher team reward.

      Mặc dù có cài đặt đơn giản, bài toán này vẫn rất khó do các tác tử cần hợp tác với nhau để đạt được kết quả tốt nhất. Từ góc nhìn của các tác tử, đây không phải lựa chọn tốt nếu chúng không muốn hợp tác với các tác tử khác.

    6. The first option for evaluating a new idea in MARL involves using a matrix and grid world task.One such example is the Two-step Game. In this task, two agents act in turn to gain the highest team reward. The task is very straightforward: two agents in the task the observation is a short vector with a length four two actions (A&B) to choose from

      Lựa chọn đầu tiên trong việc đánh giá một ý tưởng mới trong MARL là sử dụng mộ ma trận và bài toán ma trận lưới. Trong bài toán này, 2 tác tử hành động theo lượt để lấy được phần thưởng cao nhất. Bài toán này khá đơn giản: - 2 tác tử trong 1 bài toán - các quan sát là một vector có kích thước 4. - 2 hành động A và B

    7. In the context of Multi-Agent Reinforcement Learning (MARL), a dataset corresponds to a collection of scenarios that comprise a single multi-agent task. Multi-agent tasks are customizable on a variety of aspects, such as the number of agents, map size, reward function, and unit status. This section provides a brief overview of the categories of multi-agent tasks, ranging from the simplest matrix game to real-world applications.

      Trong bối cảnh của bài toán MARL, một bộ dữ liệu tương ứng với một tập các kịch bản chứa một bài toán đa tác tử đơn lẻ. Các bài toán đa tác tử có thể được tùy biến ở hàng loạt yếu tố, ví dụ như số lượng tác tử, kích thước bản đồ, hàm phần thưởng,...

  11. May 2024
    1. On the other hand, value decomposition-based algorithms can only be applied to cooperative and collaborative scenarios. These algorithms use a value decomposition technique to decompose the value function into individual value functions, one for each agent. The agents then learn their own policies based on their individual value functions. Since value decomposition-based algorithms do not use a centralized critic, they cannot be applied to competitive scenarios where the agents’ objectives conflict.

      Các thuật toán dựa trên phân giải giá trị chỉ được áp dụng cho các bài toán đa tác tử hợp tác. Các thuật toán này sử dụng một kỹ thuật để phân giải hàm giá trị thành các hàm giá trị cho từng tác tử. Các tác tử sau đó sẽ học chiến lược của riêng chúng dựa trên hàm giá trị đơn lẻ của chúng

    2. Centralized critic-based algorithms are applicable to all types of multi-agent tasks, including cooperative, collaborative, competitive, and mixed. These algorithms use a centralized critic to approximate the state-action value function, which enables agents to learn a policy that considers the actions of other agents and the global state

      các thuật toán dựa trên hàm critic tập trung hóa có thể được áp dụng cho mọi bài toán đa tác tử. Các thuật toán này sử dụng một hàm critic được tập trung hóa để ước lượng giá trị của hàm state-action, cho phép các tác tử học được chiến lược có tính đến hành động của các tác tử khác và trạng thái toàn cục.

    3. CTDE strikes a balance between coordination learning and deployment cost, making it a popular framework in MARL. Since multi-agent tasks involve numerous agents, learning a policy that aligns with the group target requires incorporating extra information from other sources. Thus, centralized training is the preferred choice. However, after training, the delivery of centralized information is too costly during deployment, leading to delays in decision-making. Furthermore, centralized execution is insecure, as centralized information can be intercepted and manipulated during transmission.

      framework CTDE có được sự cân bằng giữa việc huấn luyện hợp tác và chi phí triển khai. Với các bài toán đa tác tử, việc học một chiến lược gắn liền với một mục tiêu chung sẽ yêu cầu việc thống nhất thông tin từ các nguồn khác. Vì vậy, việc huấn luyện tập trung sẽ được ưu tiên sử dụng. Tuy nhiên, việc luân chuyển các thông tin có tính tập trung hóa yêu cầu chi phí cao trong quá trình triển khai, làm chậm đáng kể tốc độ đưa ra quyết định. Ngoài ra, việc luân chuyển loại thông tin này trong toàn bộ hệ thống là không đảm bảo do có thệ bị gián đoạn.

    4. The CTDE framework, which stands for Centralized Training & Decentralized Execution, is a widely used approach in multi-agent reinforcement learning (MARL). In this setting, agents are trained together in a centralized manner where they can access all available information, including the global state, other agents’ status, and rewards. However, during the execution stage, agents are forced to make decisions based on their local observations, without access to centralized information or communication.

      Trong framework CTDE, các tác tử được huấn luyện cùng nhau theo nguyên tắc tập trung hóa mà trong đó, chúng có quyền truy cập vào mọi thông tin hiện có, bao gồm trạng thái toàn cục, trạng thái của các tác tử khác và các phần thưởng. Tuy nhiên, trong quá trình suy luận, các tác tử sẽ phải đưa ra quyết định dựa trên quan sát cục bộ của riêng chúng mà không được phép truy cập vào các thông tin tập trung hóa.

    5. In a Partially Observable Markov Decision Process (POMDP), the system states are unobservable and probabilistically mapped to observations. The agent’s access to the system state is limited, and taking the same action can result in different observations. The observation is, however, still dependent on the system state. Hence, the agent must learn or hold a belief about its observation and learn a policy that accounts for all possible states.

      Trong POMDP, các trạng thái của hệ thống là không thể quan sát được và ở một xác suất nào đó được ghép nối với các quan sát. Mức độ truy cập của tác tử vào trạng thái của hệ thống là hữu hạn và việc thực hiện cùng một hành động có thể dẫn đến nhiều quan sát khác nhau. Tuy vậy, các quan sát vẫn phụ thuộc vào trạng thái của hệ thống.

    1. In Wang et al. (2023a), the authors proposed to train the demonstrationretriever model with combined objectives: (1) knowledge distillation from the trained reward modelwhich can capture the preferences of LLMs over the retrieved candidates (2) InfoNCE-based con-trastive loss to incorporate the in-batch negatives. More specifically, the resulting loss function is asfollows:Lcombined = αLcont + Ldistill

      Nghiên cứu của Wang đề xuất huấn luyện mô hình truy xuất với việc kết hợp các hàm mất mát: tinh chiết kiến thức từ các mô hình phần thưởng đã được huấn luyện để có thể nắm bắt được xu hướng của LLM và hàm InfoNCE

    2. nfoNCE Loss Another widely adopted training procedure is contrastive learning using the In-foNCE loss (Rubin et al., 2022; Cheng et al., 2023; Luo et al., 2023). When positive and negative11

      Sử dụng contrastive learning. Khi các mẫu thuận và nghịch có thể được xác định chính xác, hàm InfoNCE là một hàm mất mát tốt bởi nó có thể tận dụng các nhãn giám sát để tạo ra thể hiện mà trong đó, các mẫu ngữ cảnh hữu ích sẽ được đặt riêng cho quá trình truy xuất.

    3. The Determinantal Point Process model (Alex Kulesz, 2012) defines a proba-bility distribution over all the combinations of candidate demonstrations, giving high probability tosubsets that contain relevant and diverse items (Levy et al., 2022). It models diversity by incorporatingcross-candidate similarity scores, and models similarity via a per-candidate relevance score,

      Mô hình DPP của Alex xác định phân bố xác xuất trên tất cả các cách kết hợp của các ngữ cảnh ứng viên, từ đó gán xác xuất cao cho các tập ngữ cảnh chứa các ngữ cảnh liên quan và đa dạng. Nó mô hình hóa sự đa dạng bằng cách hợp nhất các điểm tương đồng, và mô hình hóa sự tương đồng thong qua điểm liên quan của mỗi ngữ cảnh.

    4. Wang et al. (2023a) and Li et al. (2023b) instead proposed to iterate the retrievermodel multiple times. More specifically, the retriever trained in iteration i will be employed toretrieve a new set of candidates for the subsequent iteration i + 1. Such an iterative training approachallows progressively improving retriever quality by mining better positive and hard negative examplesat each iteration

      Nghiên cứu của Wang đã đề xuất việc lặp lại mô hình truy xuất nhiều lần. Cụ thể, mô hình truy xuất được huấn luyện ở vòng lặp thứ i sẽ được sử dụng để truy xuất một tập các ngữ cảnh cho vòng lặp tiếp theo là i +1.Việc huấn luyện như vậy sẽ giúp cải thiện dần chất lượng của mô hình truy xuất bằng cách xác định các mẫu thuận và nghịch tốt hơn.

    5. Distillation by KL Divergence Ye et al. (2023a) claims that although the InfoNCE loss has beenfound effective in training demonstration retrievers and can learn which examples might be superiorto others, it has the same treatment for all negative examples and the predicted scores from LLMare not fully utilized.

      Nghiên cứu của Ye tuyên bố rằng mặc dù hàm ìnoNCE được cho là rất hiệu quả trong việc huấn luyện các mô hình truy xuất và có thể học để biết được mẫu ngữ cảnh nào là tốt hơn, nó lại khiến cho mô hình xem các mẫu nghịch là như nhau và từ đó, việc chấm điểm từ LLM là không được tối ưu

    6. s an alternative to train a demonstration retriever using positive and negativeexamples, Shi et al. (2022) proposed to train the retriever by directly distilling the LLM’s scoringfunction. More specifically, the retriever model is designed to produce ranking scores that matchthe usefulness of a demonstration to help with the LLM inference; this is done by minimizing theKL-divergence between the top K examples score distribution from scoring LLM and the rankingscore distribution produced by the retriever

      Nghiên cứu của Shi đã đề xuất việc huấn luyện mô hình truy xuất bằng cách tinh chiết trực tiếp từ hàm cho điểm của LLM. Cụ thể hơn, mô hình truy xuất được thiết kể để đưa ra các điểm xếp hạng tương ứng với sự hữu dụng của các ngữ cảnh trong việc giúp LLM suy luận. Điều này được thực hiện bằng cách tối thiểu hóa độ phân kì KL giữa phân bố điểm chấm bởi LLM của k ngữ cảnh tốt nhất và phân bố điểm chấm bởi mô hình truy xuất.

    7. In the list-wise ranking objective, retriever can benefit from the full ranking of the candidate set to makeaccurate predictions for the most relevant demonstrations. However, obtaining the full rankinglist and calculating the loss function on top of it might be very expensive and time-consuming.Additionally, the model is trained to discern the relative preferences between examples withoutexplicitly determining whether an example can serve as an absolute good demonstration

      Việc sử dụng hàm huấn luyện xếp hạng list-wise giúp cho mô hình truy xuất hưởng lợi từ việc xếp hạng đầy đủ để có thể đưa ra được dự đoán chính xác cho các ngữ cảnh liên quan nhất. Tuy nhiên việc lấy tất cả các xếp hạng và tính toán hàm mất mát trên đó là rất đắt đỏ và tốn thời gian

    8. he list-wise ranking approach looks at a list of candidate documents fora given query and tries to capture the correct ordering for it. Li et al. (2023b) proposed to inject theranking signals into the retriever using an approach inspired by LambdaRank (Burges, 2010

      Hướng giải quyết dựa trên ranking-loss sẽ tìm kiếm một tập các ngữ cảnh ứng viên cho một đầu vào là cố gắng có được thứ tự đúng cho chúng. Nghiên cứu của Li đề xuất việc tích hợp các tín hiệu xếp hạng vào mô hình truy xuất

    9. approach to collecting training data for demonstration retriever is to directlymeasure the similarity between the labels of the candidate demonstrations and the label of the query,and use this similarity as a proxy of the importance of a demonstration (Hu et al., 2022; Poesia et al.,2021).

      Một cách tiếp cận khác là trực tiếp tính toán sự tương đồng giữa các nhãn của ngữ cảnh và các nhãn của đầu vào bài toán, và sử dụng độ tương đồng này làm độ quan trọng của ngữ cảnh

    10. nce a score is obtained, a retriever can be trained that predicts these scores directly (Ye et al.,2023a). Alternatively, the candidate demonstrations can be ranked for each query based on theirscores

      Một khi đã được tính điểm xong, mô hình truy xuất có thể được huấn luyện để đoán ra các điểm đó trực tiếp

    11. ased on LLMs Signals A popular approach to collecting training examples is to use the su-pervisory signals from LLMs. In this case, a typical paradigm is to first employ some filteringmechanisms (Cheng et al., 2023) or unsupervised retrievers (e.g. BM25 and SBERT) (Luo et al.,2023) as the initial retriever, this step can help limit the pool size for mining the right training data.Then a scoring LLM, which serves as a proxy for the inference LLM, is used to score each candidatedemonstration d. Here the score is defined as s(e) = p(a|d, q) which is the conditional probability ofoutput answer a given the input query q and demonstration d. Another approach is to train a smallerreward model that can provide more fine-grained supervision for dense retrievers. For example, Wanget al. (2023a) proposed to finetune a cross-encoder model serving as a teacher model for training theretriever

      Tạo dữ liệu dựa trên tín hiệu của LLM: Hướng tiếp cận này nhắm đến việc sử dụng các tín hiệu có giám sát từ LLMs. Một quy trình phổ biến được sử dụng là trước tiên, một số thuật toán sàng lọc và các mô hình truy xuất không giám sát sẽ được chọn làm mô hình truy xuất ban đầu, giới hạn kích thước của bộ ngữ cảnh. Sau đó, một LLM dùng để chấm điểm sẽ được sử dụng để chấm điểm cho mỗi ngữ cảnh.

    12. Researchers thus have started to explore learning-based methods to further push theboundaries. A typical objective when designing a good demonstration retriever is: if an LLM finds ademonstration useful when being used as an illustrative example, the retriever should be encouragedto rank the demonstration higher

      Các nhà khoa học bắt đầu khám phá các phương pháp dựa trên việc học tập để đẩy mạnh hơn nữa khả năng truy hồi. Một mục tiêu cụ thể khi thiết kế mô hình truy hồi tốt là: nếu LLM tìm ra một ngữ cảnh là hữu ích khi sử dụng nó làm ví dụ, mô hình truy xuất sẽ nên được khuyến khí để xếp hạng cao hơn cho ngữ cảnh đó.

    13. Pretrained Dual Encoder In the context of demonstration retrieval where the goal is to identifyrelevant examples for a given query, the query is typically a question, while the examples maycontain additional information such as answers, chains of thoughts, supporting knowledge, or evenfollow different patterns. Therefore, transforming them into a uniform embedding space to calculaterelevance might not be the most effective approach. In this case, LLM retrieval architectures suchas Dual Encoder that are pretrained on retrieval or question-answering tasks can better grasp theintricate relationships between complex logical concepts and reasoning processes by employingdifferent semantic embeddings for queries and candidates (Li and Qiu, 2023b). In practice, traininga dual-encoder can be highly expensive as it typically requires a large training corpus. Fortunately,there are publicly available pretrained retrievers, although not specifically optimized for few-shotretrieval tasks, already demonstrating success in helping LLMs to learn from the selected examples.Luo et al. (2023) studied applying GTR (Ni et al., 2021) to select semantically similar examples asdemonstrations, and empirically proved that this approach brought in better performance gain thanrandom fewshots for both PaLM (Chowdhery et al., 2023) and FLAN (Chung et al., 2022) models.GTR is a T5-based dual encoder model that is pretrained on the CommunityQA (Abujabal et al.,2019) and finetuned on the MS Marco dataset (Nguyen et al., 2016). Moreover, Khattab et al. (2022)reported results for employing ColBERTv2 (Santhanam et al., 2021) as the retrieval module in theirDEMONSTRATE–SEARCH–PREDICT (DSP) framework for ICL. ColBERTv2 is a state-of-artretrieval model that adopts the late interaction architecture (Khattab and Zaharia, 2020) and is trainedon the MS Marco dataset. In the proposed framework, it is used to retrieve both (i) related knowledgeduring the search stage and (2) top k similar examples as demonstrations.

      Trong bài toán truy xuất ngữ cảnh với mục tiêu là tìm được các mẫu ngữ cảnh liên quan nhất với đầu vào của bài toán. Trong ngữ cảnh, ngoài câu đầu vào thì còn chứa các bước suy luận, câu trả lời, kiến thức liên quan... nên việc mã hóa chúng vào cùng một không gian vector nhúng là không được tối ưu. Đối với trường hợp này, các kiến trúc truy hồi LLM như Dual Encoder được pretrain trên bài toán truy xuất hoặc các bài toán q-a sẽ nắm bắt được các mối quan hệ phức tạp giữa các khái niệm logic phức tạp bằng cách triển khai các không gian vector nhúng khác nhau cho đầu vào và các ngữ cảnh

    14. Shi et al. (2022)extends the use case to cross-lingual few-shot retrieval in the Text to-SQL semantic parsing task, andthey use mSBERT (Reimers and Gurevych, 2019b), mUSE (Yang et al., 2019) and mT5 (Xue et al.,2020) as the baseline models for comparison. Other widely used baseline models for demonstrationretrieval include E5base (Wang et al., 2022b), SimCSE (Gao et al., 2021b). Instead of relying on“word matches” as in BM25, these sentence embedding similarity approaches can better capturesemantic similarity (

      Nghiên cứu của Shi mở rộng việc sử dụng các mô hình truy hồi ngữ cảnh sang việc truy hồi ngữ cảnh trong bài toán phân tích ngữ nghĩa cross-lingual Text-to-SQL

    15. Sentence Embedding Similarity In this approach, queries and documents are encoded to thesame dense embedding space using an off-the-shelf sentence embedding model, and then similarityscores (e.g. cosine similarity) are calculated to rank the most relevant documents for each query.A rich collection of sentence embedding methodologies exists in the literature.

      Tìm dựa trên tương đồng của vector nhúng câu: Trong cách tiếp cận này, câu đầu vào và ngữ cảnh được mã hóa vào cùng 1 không gian vector nhúng bằng các mô hình nhúng có sẵn.

    16. Term-based Similarity BM25 (Robertson et al., 2009) is one of the most popular term-basedscoring methods due to its simplicity and effectiveness in producing relevant results. It takes intoaccount both term frequencies and document lengths. It has been empirically demonstrated in variousworks (Luo et al., 2023; Rubin et al., 2022; Agrawal et al., 2022; Ye et al., 2023a; Dalvi et al., 2022)that using BM25 to select similar examples as few-shots in ICL can help improve the performance ofmany LLM inference tasks. While BM25 has become a standard baseline model in the field, it is notwithout its limitations. Due to its sole reliance on term frequency and document length, this approachmay overlook crucial aspects such as semantic meaning and sentence structure, potentially leading toinaccuracies in certain instances. Another drawback is that BM25 lacks the capability for fine-tuningin downstream tasks, making it less competitive compared to neural models which can be fine-tunedand customized for specific downstream tasks.

      Tìm kiếm dựa trên tương đồng về từ ngữ: BM25 là một trong những phương pháp tìm kiếm dựa trên từ ngữ phổ biến nhất do tính đơn giản và hiệu quả trong việc cho ra các kết quả mong muốn. Nó dựa trên cả độ phổ biến của từ/cụm từ và độ dài của các tài liệu.

    17. Free Form Corpus Another approach to deal with the lack of human-annotated data for similartasks is create pseudo-demonstrations from unstructured text. Toward this goal, Lyu et al. (2022)utilized the Demix dataset (Gururangan et al., 2022), which is not tailored for any specific task. Togenerate pusedo-demonstrations, a retriever selects the top-k most relevant sentences from the dataset.Subsequently, arbitrary labels are attached to each sentence to form the examples. Li et al. (2022)propose a synthetic question answering generation method to create QA pairs using the syntheticgenerated passages by an LLM

      Một cách tiếp cận khác nhằm xử lý việc thiếu các dữ liệu được chú thích thủ công là tạo ra các ngữ cảnh giả từ văn bản không có cấu trúc. Nghiên cứu của Lyu đã tổng hợp bộ dữ liệu Demix. Để tạo các mẫu ngữ cảnh giả, một mô hình truy xuất sẽ chọn k câu liên quan nhất từ bộ dữ liệu. Sau đó, các nhãn tùy ý sẽ được gán vào mỗi câu để tạo ra mẫu ngữ cảnh hoàn chỉnh.

    18. Unlabelled Queries with Automatically Generated Answers The previous three corpora allpresuppose the availability of human-annotated data. However, this assumption may not hold inreal-life scenarios, particularly in streaming settings where users can pose questions without anypre-annotated answers. Several studies (Zhang et al., 2022b; Li and Qiu, 2023b) have suggestedusing LLMs to generate answers for unlabeled data. They apply filtering techniques to determinethe quality of these generated answers, adding only those examples with high-quality answers to theretrieval corpus. The most widely used filtering technique is based on self-consistency (Wang et al.,2022c). This approach involves prompting the language model to generate multiple chains of thoughtand answers, then selecting the most common answer as the final response.

      Các truy vấn không được gán nhãn với các câu trả lời được tạo sinh tự động: Một vài nghiên cứu đã đề xuất việc sử dụng LLMs để tạo sinh câu trả lời cho các mẫu dữ liệu không được gán nhãn. Các phương pháp sàng lọc đã được áp dụng để xác định chất lượng của các câu trả lời được tạo sinh

    19. Cross-Domain In this setting, IID human-annotated demonstrations are not available for the testqueries, so one uses annotated demonstrations from other similar tasks (Cheng et al., 2023; Shi et al.,2022). Note that this is different from the mix-domain setting where part of the corpus is IID and partof it is not. For instance, Shi et al. (2022) describes a scenario where the goal is to parse a Chinesequery into SQL. However, the demonstrations are sourced from an English Text-to-SQL corpus, adomain with significantly more resources than the target domain. Shi et al. (2022) employs thishigh-resource data as the retrieval corpus. To adapt to the target domain during inference with a LLM,the target query is translated into the same language as the demonstrations. Nie et al. (2022) presentsa similar approach, retrieving demonstrations from high-resource domains to address low-resourcequeries. However, their retrieval pool consists of multiple high-resource sources

      Cross-domain: Trong cài đặt này, các ngữ cảnh được chú thích thủ công sẽ không có sẵn cho các đầu vào của bộ dữ liệu kiểm thử,vì vậy các ngữ cảnh thuộc các bài toán gần tương tự sẽ được sử dụng. Một ví dụ điển hình như trong nghiên cứu của Shi và cộng sự đã mô tả một kịch bản mà trong đó, mục tiêu là phân tích một truy vấn bằng tiếng Trung sang dạng SQL. Tuy nhiên, các ngữ cảnh được lấy nguồn từ một tập dữ liệu Text-to-SQL tiếng Anh. Nghiên cứu đã sử dụng bộ dữ liệu này làm bộ dữ liệu ngữ cảnh, Để giúp LLM thích nghi được với bài toán mục tiêu trong quá trình suy luận, truy vấn mục tiêu sẽ được dịch sang ngôn ngữ giống với ngôn ngữ của các ngữ cảnh.

    20. n the mix-domain setting (Wang et al., 2023a; Li et al.,2023b), the retrieval corpus is constructed from the combination of all tasks. At the inference time,given a question, the retriever will retrieve demonstrations from this mixed corpus; the demonstrationscan come from the same domain as the test question or from other tasks.

      Mix-domain: trong cài đặt mix-domain, bộ dữ liệu truy hồi được xây dựng từ việc kết hợp tất cả các bài toán với nhau. Trong quá trình infer, với một câu hỏi, mô hình truy xuất sẽ truy xuất các ngữ cảnh từ bộ dữ liệu mix-domain, các ngữ cảnh có thể đến từ cùng một domain với đầu vào của bài toán hoặc từ một domain khác.

    21. n this setting, an in-domain training set, independently and identically distribution(IID) with the test queries, is available and serves as the retrieval corpus. Most existing work takethe full training set as the corpus. However, to be more annotation efficient, Hongjin et al. (2022)uses only a subset M of the training set N which includes the most representative and diverse ones,where |M | << |N |. One question that remains unanswered from the work of Hongjin et al. (2022)is how the predictive performance is affected as a function of retrieving from a subset M insteadof the entire training set N . While there is no follow-up work to answer this question, the closestcomparison we find is the results in Ye et al. (2023a) where a similar setup as Hongjin et al. (2022) isused except that they use the entire training set as the retrieval corpus, and report lower performanceon the SST-5 dataset (compare the Figure 3 in Hongjin et al. (2022) and Table 3 in (Ye et al., 2023a)).While there might be other differences between the two setups that may affect the final performance,this comparison implies that retrieving from a carefully selected subset might have comparable resultsto retrieving from the entire training set.

      In-domain: Trong cài đặt này, một bộ dữ liệu huấn luyện in-domain, có phân bố độc lập với bộ dữ liệu test, là có sẵn và đóng vai trò là bộ dữ liệu truy hồi. Hầu hết các nghiên cứu hiện nay đều sử dụng toàn bộ dữ liệu. Tuy nhiên Hongjin đã chỉ sử dụng một tập nhỏ dữ liệu M trong đó sao cho tập nhỏ này bao hàm các mẫu đa dạng và có thể đại diện cho toàn bộ bộ dữ liệu.

    22. This setting assumesthat training data related to a task is available, and thus can be used as the retrieval corpus

      Lưu ý: Bộ dữ liệu huấn luyện liên quan đến một bài toán đã được quy ước là có sẵn, vì vậy có thể được sử dụng làm bộ dữ liệu truy hồi.

    23. terative Retrieval The earlier retrieval strategies acquire each demonstration independently.However, in iterative retrieval, a retriever selects demonstrations based on both the query andpreviously retrieved demonstrations. This process starts with a single query, for which the retrieverfinds one best demonstration. The query is then augmented (e.g. combined with the demonstration) toretrieve the next demonstration. This step is iteratively executed k times to gather k demonstrations.The general idea is to select the demonstrations that can complement each other. An an example of awork from this categorym, Scarlatos and Lan (2023) train an LSTM retriever using a reinforcementlearning framework. During the inference phase, the retriever processes the input query to select thebest initial demonstration. It then generates a new query representation by integrating the query withprior demonstrations, specifically utilizing the hidden state representation from the LSTM model.This process of updating the query representation and obtaining subsequent demonstrations continuesiteratively until k demonstrations are retrieved

      Truy xuất lặp lại: khác với các phương pháp trên truy xuất ngữ cảnh một cách độc lập với nhau, phương pháp này chọn ngữ cảnh dựa trên đầu vào của bài toán và các ngữ cảnh được lấy trước đó. Nguyên tắc chính của phương pháp này là chọn các ngữ cảnh có thể hoàn thiện ý nghĩa cho nhau.

    24. Clustering Retrieval To mitigate the issue of homogeneity in one-hot retrieval, clustering retrievalapproaches (Li et al., 2022; Zhang et al., 2022b; Li and Qiu, 2023b) categorize all demonstrationsinto k sub-groups aiming to group similar demonstrations together. Then given a query, the retrieverpicks the most similar demonstration from each sub-group resulting in a final set of k demonstrations.The core principle of clustering is to select a diverse range of demonstrations. Most of the work useSBERT Reimers and Gurevych (2019a) to encode the demonstrations (only the question or the entiredemonstrations) and then apply k-means for clustering.

      Truy xuất phân cụm: Để hạn chế sự đơn điệu trong phương pháp truy xuất one-hoc, các phương pháp truy xuất phân cụm sẽ chia tất cả các ngữ cảnh thành k cụm. Với mỗi đầu vào của bài toán, ngữ cảnh có sự tương đồng cao nhất sẽ được chọn. Từ đó, k ngữ cảnh được chọn. Nguyên tắc chính của phương pháp truy xuất này là chọn một tập các ngữ cảnh đa dạng.

    25. One-hoc Retrieval This is the most basic retrieval strategy. To obtain k demonstrations, given aquery, the retriever ranks the demonstrations based on some scoring criteria and then selects the top-kdemonstrations. Thus, each demonstration is chosen independently of the others. This method isstraightforward and fast, however, it might not yield the best combination of k demonstrations asthese demonstrations might be homogeneous.

      Truy xuát one-hoc: đây là phương pháp truy xuất cơ bản nhất.Mô hình truy xuất các ngữ cảnh dựa trên một số tiêu chí và chọn ra k ngữ cảnh tốt nhất. Vì vậy, các ngữ cảnh được chọn độc lập với nhau.

    26. Levy et al. (2022) found thatdiversity and coverage are important when the model is unfamiliar with the output symbols space. Itis noteworthy that researchers have found that ICL benefits more from demonstrations with highercomplexity in some scenarios (Fu et al., 2022), where they define the complexity in terms of the querylength or reasoning steps

      Nghiên cứu của Levy cho thấy độ đa dạng và tính bao phủ là rất quan trọng, khi mà mô hình không quen với các nhãn trong tập nhãn đầu ra. Đáng lưu ý là các nhà khoa học đã phát hiện ra rằng phương pháp ICL được hưởng lợi từ việc các ngữ cảnh có độ phức tạp cao trong một vài kịch bản nhất định

    27. Beyond similarity, some work has found that the diversity of demonstrationsis important. The motivations for diversity include avoiding repetitive demonstrations (Zhanget al., 2022b), bringing different perspectives (Yu et al., 2023), and maximizing the demonstrations’coverage of the test query, in terms of covering either its words or syntactic structures (Levy et al.,2022).

      Bên cạnh việc tìm kiếm dựa trên sự tương đồng, một số nghiên cứu còn cho thấy sự đa dạng cảu các ngữ cảnh cũng rất quan trọng. Động lực cho các nghiên cứu này bao gồm việc tránh phải việc chọn phải các ngữ cảnh giống nhau, mang đến nhiều góc nhìn mới và tốt đa hóa độ bao phủ của các ngữ cảnh đối với đầu vào của bài toán trên phương diện về từ ngữ và các cấu trúc cú pháp.

    28. Similarity involves selecting demonstrations most akin to the query and can be basedon language similarity (term matching or semantic matching), structural aspects (sentence structure,reasoning structure, etc.), or other criteria. Most studies focus on language similarity, with feweraddressing structural similarity, often due to the challenges in extracting a query’s structure in manytasks (Levy et al., 2022).

      Sự tương đồng liên quan đến việc chọn các ngữ cảnh giống với đầu vào của người dùng nhất, dựa trên tương đồng về mặt ngôn ngữ (tương đồng trong câu từ hoặc ngữ nghĩa), tương đồng về cấu trúc (cấu trúc câu, câu trúc suy luận,...) và các tiêu chí khác. Hầu hết mọi nghiên cứu đều tập trung vào tương đồng về mặt ngôn ngữ thay vì đề cập đến tương đồng về mặt cấu trúc, chủ yếu là do các thách thức trong việc trích xuất cấu trúc có trong đầu vào của nhiều bài toán.

    29. here are two primary retrieval objectives for selecting demonstrations: similarityand diversity.

      Hai mục tiêu chính trong việc chọn các ngữ cảnh: độ tương đồng và độ đa dạng.

    30. emonstration Formatting: Various works have shown that the formatting and wording of theprompts can play a crucial role in the performance of the LLM (Jiang et al., 2020; Shin et al., 2020;Kojima et al.; Yang et al., 2023). For example, Kojima et al. show that simply adding Let’s thinkstep by step to the prompt makes LLMs reason step by step and solve substantially more problems,and Weller et al. (2023) show that adding According to Wikipedia to the prompt makes them morefactual. Moreover, Min et al. (2022b) shows that besides the text formatting, the label space and thedistribution of the input text in the demonstrations are also of immense importance

      Bố cục của prompt ảnh hưởng đáng kể đến hiệu quả của LLMs. Nghiên cứu của Min và cộng sự cho thấy bên cạnh bố cục của chỉ dẫn, tập nhãn và phân bố của các văn bản đầu vào trong tập ngữ cảnh cũng vô cùng quan trọng.

    31. Traditionally, the same set of few-shot demonstrations is used on all queries, which can be suboptimalespecially when there are high variations among the queries. An alternative is to retrieve few-shotdemonstrations that are tailored to the current query. Previous work has shown that demonstrationretrieval leads to substantial improvements in the task metrics, compared to manually curated orrandomly selected demonstrations (Luo et al., 2023; Ye et al., 2023a). Furthermore, LLMs have beenshown to become less sensitive to the factors such as demonstration ordering (Section 2.2) whenretrieved demonstrations are used (Li et al., 2023b)

      Việc sử dụng bộ ngữ cảnh cố định cho tất cả các đầu vào là không tối ưu, đặc biệt là với các bài toán có sự khác nhau lớn giữa các đầu vào. Một cách tiếp cận mới được sử dụng là truy hồi một lượng ngữ cảnh nhất định và nối đầu vào của bài toàn vào đó. Nghiên cứu của Li cũng cho thấy LLM ít nhạy cảm hơn với các yêu tố như thứ tự của ngữ cảnh khi các ngữ cảnh được truy xuất.

    32. Chain of Thought (CoT): It has been shown that including a rationale for the answer significantlyimproves model performance, especially for models that are larger than a certain size (Suzgun et al.,2022). The rationale is commonly known as chain of thought (CoT) (Wei et al., 2022). In the case ofCoT prompting, the demonstrations are typically formatted as:

      Việc thêm các bước lý giải vào giữa đầu vào và đầu ra của một ngữ cảnh giúp tăng đáng kể hiệu quả của mô hình. Các bước lý giải này thường được gọi là một chuỗi suy nghĩ.