Cookbook: A framework for improving LLM generative abilities via programmatic data generating templates

Fine-tuning large language models (LLMs) on instruction datasets is a common way to improve their generative capabilities. However, instruction datasets can be expensive and time-consuming to manually curate, and while LLM-generated data is less labor-intensive, it may violate user privacy agreements or terms of service of LLM providers. Therefore, we seek a way of constructing instruction datasets with samples that are not generated by humans or LLMs but still improve LLM generative capabilities. In this work, we introduce Cookbook, a framework that programmatically generates training data consisting of simple patterns over random tokens, resulting in a scalable, cost-effective approach that avoids legal and privacy issues. First, Cookbook uses a template -- a data generating Python function -- to produce training data that encourages the model to learn an explicit pattern-based rule that corresponds to a desired task. We find that fine-tuning on Cookbook-generated data is able to improve performance on its corresponding task by up to 52.7 accuracy points. Second, since instruction datasets improve performance on multiple downstream tasks simultaneously, Cookbook algorithmically learns how to mix data from various templates to optimize performance on multiple tasks. On the standard multi-task GPT4ALL evaluation suite, Mistral-7B fine-tuned using a Cookbook-generated dataset attains the best accuracy on average compared to other 7B parameter instruction-tuned models and is the best performing model on 3 out of 8 tasks. Finally, we analyze when and why Cookbook improves performance and present a metric that allows us to verify that the improvement is largely explained by the model's generations adhering better to template rules.

Paper

Similar papers

Reviewer HqBe6/10 · confidence 3/52024-05-09

Summary

This paper introduces an automatic framework called Cookbook to construct instruction tuning data without the involvement of human-written data and LLM-generated data. Cookbook generates instruction-tuning data according to programmatic templates of pattern-based rules, and applies the rules to a random token space. To improve performance on multiple tasks, the authors also propose a mixing algorithm over Cookbook templates called Cookbook-Mix. Experiments show that Llama-2 and Mistral finetuned on Cookbook-Mix generated data outperform the base models on the GPT4All benchmark. Analysis shows that the rules taught by templates are crucial to model performance.

Rating

6

Confidence

3

Ethics flag

1

Reasons to accept

1. The idea of constructing instruction datasets via pattern-based rules over random tokens is interesting and courageous. It could be a great starting point and enlighten future works. 2. The paper is well-written. It clearly describes how the templates are constructed and mixed, and how the template alignment scorer works. The analysis section is well-organized and addresses several potential concerns.

Reasons to reject

1. All the rules designed for tasks in the main content of the paper are based on token overlapping. This may limit the scope of tasks to which this method can be applied, and may teach models to learn shortcuts. For example, the choice that overlaps more with the question is not necessarily the correct answer. The authors acknowledge the restriction and add the task of poetry generation in the appendix, but the template needs more human effort like designing the rhyme_dict, and is unlikely to be generated automatically. 2. The experiments could be further supplemented to make the claims more convincing. a) The framework could be evaluated on more benchmarks besides GPT4ALL, like Open LLM Leaderboard and BigBench-Hard. More instruction-tuned Llama-2 and Mistral models report their performances on these benchmarks. b) The instructed versions of Llama-2 and Mistral (Llama-2-chat and Mistral-Instruct) could serve as baselines. c) For the single-task evaluation, the performance of the 7B models could also be reported.

Reviewer HqBe2024-05-31

Response to the authors

Thank you for replying to my concerns and adding the experiments. However, I may have a different view of shortcuts. Although shortcuts may help models perform well in benchmarks, they are spurious correlations or unwanted biases in the benchmarks. Models that rely on shortcuts may show overestimated capabilities, and could be easily attacked. [1] Friedman, Dan, Alexander Wettig, and Danqi Chen. "Finding Dataset Shortcuts with Grammar Induction." Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing. 2022. [2] Sun, Zechen, et al. "Exploring and Mitigating Shortcut Learning for Generative Large Language Models." Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLING 2024). 2024.

Reviewer G5a96/10 · confidence 4/52024-05-11

Summary

The paper introduces Cookbook, a framework designed to generate instruction datasets that enhance large language model (LLM) performance without relying on human or LLM-generated samples. Instead, Cookbook programmatically creates training data using simple patterns over random tokens via Python functions. It generates training data to help the model learn explicit rule-based patterns for specific tasks. The authors also propose a method to mix data from different templates to improve performance across various tasks simultaneously.

Rating

6

Confidence

4

Ethics flag

1

Reasons to accept

**1. Interesting method**: It is very interesting to use code to help us automate the training data generation process. It is a completely novel paradigm than the pure natural language-based methods.

Reasons to reject

**1. Limited application scenarios**: Based on the examples in Figure 2 and my analysis, the program appears to generate very preliminary span-level or lexical-level training data. It is likely due to the ease of using Python string operations for synthesis. However, this approach seems less effective for generating more semantically complex QA questions or broader user instructions, as Python code alone may struggle to manipulate question semantics effectively. Also, the authors focus their model testing exclusively on QA-related tasks, rather than exploring a wider range of more general tasks that would better demonstrate the framework's broader applicability. **2. Lack of more in-depth evaluation**: The authors use code to generate training data but overlook other baselines that also facilitate QA data generation. At least, the authors could conduct experiments using Self-Instruct methods to generate QA training data and verify whether the proposed approach truly surpasses Self-Instruct. In my view, particularly for QA tasks, Self-Instruct-style methods appear better suited for generating a broad range of QA questions, irrespective of domain, text length, or format. Moreover, the baselines currently compared to Cookbook weren't specifically trained on QA-style data, potentially contributing to their lower performance relative to Cookbook. **3. Weird performance linear assumption**: The authors introduce a method to control template proportions in training data based on the assumption that the accuracy of a model trained on a weighted mixture of templates is equivalent to the weighted average accuracy of models individually trained on each template. However, this assumption may be flawed because models specifically trained on one template (e.g., A) tend to perform better on corresponding template-based QA tasks than models trained on a more diverse mixture of templates (e.g., A, B, C, D). In this case, B, C, and D would be out-of-distribution data for the A-based test set. The authors need to conduct experiments to validate this assumption before making claims about its feasibility.

Reviewer cdUR6/10 · confidence 3/52024-05-14

Summary

This paper presents an approach, generating instruction dataset prgramatically, in stead of relying on human or LLM based instrcution dataset. Three downstream tasks were selected, where the process of generating datasets were detailed. The paper also indicated that the programmatic data generation contributes to privacy by operating over a random token space, which avoids privacy and legal concerns as it does not involve the use of real user data or violate the terms of service of LLM providers. The evaluation is carried using accuracy (single and mixed - multitaks setup). The paper is easy to read. However, the way the datasets are selected prgramatically, for example for the QA, which part of the document and what kind of question would be included is not clear. It is mentioned that LLMs are involved in the process but I could not understad the process. Moreover it is not clear or checked how the approach solve the privacy issue.

Rating

6

Confidence

3

Ethics flag

1

Reasons to accept

- Programatic instruction data generation - Evaluation approaches in place

Reasons to reject

- The theoretical appraoch of generating the dataset is sound, but practically, how can we generate (or select ) the dataset from the source is not clear - The distiniction from the LLM based instruction dataset generation is not clear - A lot of important content are presented in the Appendixes

Questions to authors

You have a lot of concept in the appendix which makes the paper hard to understand.

Reviewer 5LFp7/10 · confidence 3/52024-05-19

Summary

This paper introduces COOKBOOK, a new framework designed to boost the generative abilities of LLMs with programmatically generated training data. Unlike recent methods that rely on costly human-curated or LLM-distilled datasets, COOKBOOK uses Python functions to create data templates that could generate random token samples as the instruction-tuning instances. These templates teach models specific pattern-based rules, making the data generation process scalable and free from privacy concerns. The authors show that models fine-tuned with COOKBOOK could significantly improve their performance on various NLP tasks. Besides, the COOKBOOK-MIX algorithm can select data from multiple templates to further enhance performance. Experimentally, the results are impressive. Models fine-tuned on COOKBOOK beat other instruction-tuned LLMs on several benchmarks. The authors also conduct in-depth analyses to show that why templates based on random token sequences can improve model performance.

Rating

7

Confidence

3

Ethics flag

1

Reasons to accept

1. Using templates to generate instruction-tuning data with random token sequences is a novel idea for me. It appears that LLMs have sufficient natural language understanding to learn instruction-following abilities even from pattern-based, unreadable pseudo-data. 2. The authors conducted extensive experiments on different LLMs across various benchmarks, and the results are impressive, strongly supporting their claims. 3. Additionally, the authors provided empirical analyses to explain why these template and random token sequence-based data still work effectively.

Reasons to reject

1. The baselines (instruction-tuning datasets) compared by the authors seem to focus primarily on open-ended conversations, while the tests mainly involve traditional NLP tasks. Including more instruction-tuning datasets on these NLP tasks like FLAN could make the experiments more convincing. 2. The experimental descriptions in the paper are sometimes too brief, making it hard to follow. For instance, the sizes of the different datasets used (both baseline and COOKBOOK) and various training details are either omitted or scattered across the Appendix. 3. I find the design of the QA-related templates unclear and not well-motivated. For example, for Document QA, why is the answer set to the k tokens before and after the question? And why is k set to 3 (Appendix B.3)?

Questions to authors

I have a question regarding data size. Intuitively, if too much unreadable data is introduced during the SFT stage, it might potentially degrade the model's natural language understanding capabilities. Did the authors conduct experiments on this? Although the proposed method can generate unlimited data scalably, could introducing too much of this data gradually impair the model's overall generative ability?

Authorsrebuttal2024-06-03

Dear reviewer cdUR, We greatly appreciate your valuable feedback and suggestions! To address your concerns, we have provided clarifications as to how we generate Cookbook templates in an automated manner and how we select templates for downstream tasks. We have also provided more details on the key distinctions between Cookbook and LLM-based datasets, demonstrating empirically that Cookbook is more scalable and cost-effective. As the discussion period ends on Thursday, we are happy to answer any additional questions you may have until then. If our response and additional results have addressed your questions and concerns, we would be very grateful if you could acknowledge our rebuttal and consider adjusting your score accordingly.

Authorsrebuttal2024-06-03

Dear Reviewer HqBe, We greatly appreciate your valuable feedback and suggestions! To address your concerns we provide empirical evidence as to why the heuristics used in our templates lead to generalized reasoning vs. learning shortcuts, demonstrate how our approach for automated template generation can expand to more complex tasks (i.e., templates for poetry generation that require generating rhyming dictionaries), and expand our experimental baselines to include Llama-2-chat and Mistral-Instruct (which the best Cookbook model outperforms). As the discussion period ends on Thursday, we are happy to answer any additional questions you may have until then. If our response and additional results have addressed your questions and concerns, we would be very grateful if you could acknowledge our rebuttal and consider adjusting your score accordingly

Authorsrebuttal2024-06-03

Dear Reviewer G5a9, We greatly appreciate your valuable feedback and suggestions! To address your concerns, we provide clarifications on the broader application of Cookbook (demonstrating its ability to expand to creative tasks such as poetry generation), expand our evaluations to include Mistral-Instruct and Self-Instruct (showing that Cookbook outperforms both of these), and provide empirical evidence as to why our linear assumption holds. As the discussion period ends on Thursday, we are happy to answer any additional questions you may have until then. If our response and additional results have addressed your questions and concerns, we would be very grateful if you could acknowledge our rebuttal and consider adjusting your score accordingly.

Reviewer G5a92024-06-04

Thank you for replying to my concerns! It addresses part of my questions. I'm more convinced by the strong performance and some empirical validation for the assumptions. Therefore, I will raise my score.

Program Chairsdecision2024-07-10

Decision

Accept

© 2026 NYSGPT2525 LLC