SpeciaLex: A Benchmark for In-Context Specialized
Lexicon Learning
Abstract
Specialized lexicons are collections of words with associated constraints such as special definitions, specific roles, and intended target audiences. These constraints are necessary for content generation and documentation tasks (e.g., writing technical manuals or children’s reading materials), where the goal is to reduce the ambiguity of text content and increase its overall readability for a specific group of audience. Understanding how large language models can capture these constraints can help researchers build better, more impactful tools for wider use beyond the NLP community. Towards this end, we introduce SpeciaLex, a benchmark for evaluating a language model’s ability to follow specialized lexicon-based constraints across diverse subtasks with test instances covering core tasks of Checking, Identification, Rewriting, and Open Generation. We present an empirical evaluation of open and closed-source LLMs and discuss insights on how factors such as model scale, openness, setup, and recency affect performance upon evaluating with the benchmark.111We will release SpeciaLex including all research artifacts associated with its development (code, data, tasks) upon publication of this paper.
SpeciaLex: A Benchmark for In-Context Specialized
Lexicon Learning
Joseph Marvin ImperialΩ,Λ Harish Tayyar MadabushiΛ ΛUniversity of Bath, UK ΩNational University, Philippines [email protected] [email protected]
1 Introduction
The adoption of large language models (LLMs) for domains beyond computing and AI has been more evident in recent years, particularly with the release of publicly accessible chat interfaces such as ChatGPT. This widespread use from various multidisciplinary communities can be primarily attributed to modern LLMs’ capabilities to learn patterns from just a few examples during inference—in-context learning (ICL)—combined with the use of modern architectures and massive and diverse datasets to train them to follow complex instructions Wei et al. (2022b); Chung et al. (2022); Brown et al. (2020). With in-context learning, LLMs can be treated as task-agnostic systems and can do virtually any text-related task, including open-ended generation and structured prediction, just by being conditioned to provide completions for prompts given task-specific demonstrations Brown et al. (2020); Radford et al. (2019, 2018).
![Refer to caption](x1.png)
One particular point of interest in the wider adoption of LLMs is evaluating how they can capture lexicon-based constraints for generating text content across different domains. For example, in education, a teacher who knows how to masterfully use an LLM (e.g., ChatGPT) to generate classroom-ready reading materials on the fly can accommodate students’ various interests in reading Kasneci et al. (2023), such as prompting the LLM with preferred topics for stories and custom character roles. However, if used this way, the LLM should learn constraints such as knowing what specific words are readable by a target audience (e.g., ages 10-11). These special words are often found on specially curated lexicons such as the Oxford 5000 Wordlist222https://www.oxfordlearnersdictionaries.com/wordlists/. In technical writing, on the other hand, an LLM should learn to capture customized word definition constraints as mandated by existing guidelines and standards to avoid producing ambiguous texts. For example, as per Simplified Technical English (STE)333https://www.asd-ste100.org/ guidelines, the word glue cannot be used as a verb to mean stick together; the appropriate word for this is bond or attach.
Understanding how current LLMs capture fine-grained constraints from specialized lexicons across domains opens a number of opportunities for improving their ability to follow instructions at a very fine level, particularly through in-context learning. However, the main gap here is that there are currently no comprehensive evaluation studies or benchmarks to guide researchers in learning more about the performance and limitations of modern LLMs on content generation tasks requiring compliance with said constraints.
In this study, we fill the gap by introducing SpeciaLex, a comprehensive benchmark suite composed of diverse tasks to evaluate the capabilities of LLMs in capturing lexicon-based constraints such as special roles or part-of-speech, special word definitions, and target audiences. We provide an in-depth comparison of state-of-the-art LLMs as baselines and release extendable SpeciaLex subtask data comprising test instances. We devised four core task variations spanning Checking, Identification, Rewriting, and Open Generation. Implementation-wise, we structured SpeciaLex to focus on using in-context learning for all tasks as this emulates the most common way for lay people and users to interact with LLMs through carefully structured prompts with examples or demonstrations.
By evaluating a diverse set of commercial and open LLMs in terms of task performance, scale, and openness, SpeciaLex serves as a valuable reference and guide for interdisciplinary researchers who require the use of capable LLMs but are on a limited computing budget or are concerned only with performance on specific constraints. Moreover, by following design principles from established open LLM benchmarks such as LegalBench Guha et al. (2024), the research community can extend and build upon SpeciaLex by contributing new tasks and specialized lexicons from other domains to expand the evaluation of LLMs in this direction.
2 Related Work
Benchmarks for Content Generation. Parallel to its widespread adoption, the rise of benchmark studies has also gained significant traction from the LLM community. For generative tasks, existing works have explored evaluating general aspects such as factuality Muhlgay et al. (2024), model hallucinations Li et al. (2023), safety and toxicity Röttger et al. (2023); Hartvigsen et al. (2022); Gehman et al. (2020), low-resource language and multilingual capabilities Chen et al. (2022); Liang et al. (2020), and surface-level properties and lexical constraints Kew et al. (2023); Sun et al. (2023); Gehrmann et al. (2021) to name a few. To our knowledge, no existing benchmark has yet to consider evaluating LLMs for capturing special definitions, specific roles or part-of-speech, and knowledge of recognizable words of target audiences, which SpeciaLex aims to fulfill.
Augmenting Lexicons and Dictionaries to LLMs. The use of lexicons and dictionaries has served as an additional knowledge base for LLMs across a number of tasks. He and Yiu (2022) used the Oxford dictionary to finetune BART models to generate appropriate sentence examples based on words. Yu et al. (2022) used dictionary definitions of rare words to improve the pre-training of LLMs. Similarly, Wu et al. (2022) also used specialized lexicons to improve the contrastive learning objective of pertaining BERT and RoBERTa models for tasks such as abusive language detection and sentiment analysis. Our use of lexicons for SpeciaLex serves as a reference of constraint for LLMs for content generation tasks.
Domain Adaptation of LLMs. Researchers from interdisciplinary fields are working with the NLP community to evaluate the domain-specific capabilities of LLMs. A few of these collaborations include notable works such as LegalBench Guha et al. (2024) with tasks for legal reasoning, ChemLLMBench Guo et al. (2023) with tasks for understanding, explaining, and prediction tasks in practical chemistry, RAFT Alex et al. (2021) with multidisciplinary tasks, and PubMedQA Jin et al. (2019), MedMCQA Pal et al. (2022), and MedBench Cai et al. (2024) for biomedical question answering. SpeciaLex draws similar motivation with LegalBench Guha et al. (2024), RAFt Alex et al. (2021), and ChemLLMBench Guo et al. (2023) in terms of benchmark typology and evaluation method via in-context learning, which is further expanded in the succeeding sections.
3 SpeciaLex: A Benchmark for In-Context Specialized Lexicon Learning
We build SpeciaLex as a general benchmark and reference for evaluating LLMs to capture lexicon-based constraints through in-context learning. We discuss the task typology and recognized lexicon-based constraints of SpeciaLex as seen in Figure 1.
3.1 Constraint Types
We select three general lexicon-based constraint types for SpeciaLex as the reference for controlling the generation of text content from LLMs. The selection of these constraints has been derived from consultations with domain experts (further discussed in Section 4) and from surveying the overlap of constraints from existing works on dictionary-based augmentation with LLMs He and Yiu (2022) and controllable text generation Sun et al. (2023); Zhou et al. (2023). We describe the conditions of each lexicon-based constraint below:
C1 - Specific Roles describes the constraint that restricts a word from a lexicon from having multiple roles via part-of-speech (POS) information in a text and recommends an alternative word with a specific POS. For example, the word brush can only be used as a noun referring to the cleaning material and not as a verb referring to brushed or brushing and should be treated as the replacement word for unapproved words such as scrub. Evaluation-wise, an LLM must be able to generate a text where a given word is replaced with its alternative and its approved POS. This constraint is particularly prevalent in technical writing guidelines such as Simple Technical English (STE) for developing manuals to reduce context ambiguity Knezevic (2015).
C2 - Special Definition describes the constraint that a word must be used according to its special domain-specific definition. Similar to Specific Roles, this helps significantly reduce ambiguity in writing given that the common English language uses homonyms444Words with two or more meanings.. For example, in Simple Technical English (STE), the word close in a sentence should only mean blocking of entrance and not having two materials near each other. Evaluation-wise, a model must ensure that the special definition of a word is preserved in the text.
C3 - Target Audience describes the constraint that target audiences or readers are associated with specific groups of words that domain experts think they can easily read. Evaluation-wise, an LLM must be able to maximize the use of readable words appropriate for a target audience for generating content. An example constraint resource for this is the Oxford 5000 lexicon, containing sets of words for each increasing level in the CEFR scale (A1, A2, B1, B2, and C1) curated by experts in language assessment. In SpeciaLex, we explore two levels of conformity to the resource lexicons for the target audience: full () and minimal (). We draw support from empirical studies in reading such as by Laufer (1989) and Hsueh-Chao and Nation (2000), which states that a reading material must have at least of the content words readable by a learner to ensure effective comprehension of the text. Through SpeciaLex, researchers from other domains can explore setting different levels of conformity based on their theoretical grounding.
Tasks | Constraints | |||||
---|---|---|---|---|---|---|
|
|
|
(C1+C2) | |||
Checking | 72 | 64 | 115 | - | ||
Identification | 77 | 69 | 108 | - | ||
Rewriting | 300 | 82 | 106 | 67 | ||
Open Generation | 175 | 175 | 200 | 175 |
3.2 Task Typology
For each task , we define a prompt , which describes the official task instruction as an input to the LLM and a set of task-specific demonstrations conforming to a constraint . We set as the minimum number of in-context learning examples similar with existing benchmarks such as LegalBench Guha et al. (2024) and RAFT Alex et al. (2021). We describe the setup for each task below:
T1 - Checking involves validation of a given input text whether to conforms to a specified constraint. As a validation task, the constraint can only be one of the three recognized SpeciaLex constraints. The outputs for Checking tasks are binary YES or NO.
T2 - Identification is another validation-type task that involves listing (non)conformity of an input text from a given task and lexicon-based constraint. The variation of Identification spans recognizing what word or set of words violate specific roles, special definitions, or target audience assigned by recognized constraints as well as identifying the most appropriate correct target audience.
T3 - Rewriting involves reconstructing an input text that violates a given lexicon-based constraint into a correct version which will be evaluated accordingly. We consider Rewriting as a semi-open generation task since the output is no longer structured like Checking or Identification, but the LLM still has a reference to the incorrect version and in-context demonstrations as guidance.
T4 - Open Generation is a full open-ended generative task that requires the LLM to generate a constraint-compliant output on-the-fly from the input text and task-specific demonstrations. Moreover, unlike Rewriting, each Open Generation task instance has no reference to an incorrect version and only the word and its associated constraint it needs to generate with, which makes this task more challenging.
4 SpeciaLex Task Construction Process
This section provides an overview of the construction process we followed for building and evaluating tasks for SpeciaLex with resources provided by experts.
4.1 Collaborative Element
Throughout this study’s development, we collaborated with two domain expert representatives from the Simplified Technical English Maintenance Group (STEMG) and one from the Common European Framework of Reference for Languages (CEFR)555https://www.coe.int/en/web/common-european-framework-reference-languages. We covered discussions for the acquisition of shareable machine-readable corpora, the conduct of periodical discussions of experiment results, and validation of automatic metrics used for SpeciaLex described in the succeeding subsections. With this, we consider SpeciaLex as an LLM benchmark where domain experts have significantly contributed to its design and development.
4.2 Specialized Lexicon Data
For constructing the test cases in SpeciaLex, we use globally-recognized specialized lexicons in English, both used in technical writing and language assessment, to capture the three core constraints described in Section 3. Additional information can be found in Appendix C.
Simple Technical English Lexicon (STE) is an international industry-standard specification of controlled language used for simpler and clearer English technical documentation developed by the European Association of Aerospace Industries (AECMA). Previously exclusively used within aerospace engineering, STE has been adopted in many fields, including education, defense, and maintenance, and used across tasks such as machine translation and simplification Kuhn (2014). STE has a lexicon component that contains words with associated alternative words and part-of-speech information and with special definitions. These constraints aim to reduce ambiguity and ensure that the text can be easily understood by non-native English speakers. We use the lexicon of STE Issue 7 (released 2017) to manually construct test instances for the tasks classified evaluating Specific Roles and Special Definition constraints for SpeciaLex.
Oxford 5000 Lexicon is an expanded open-source compilation of English words distributed across the associated levels in the Common European Framework of Reference for Languages (CEFR) Framework published by the Oxford University Press. This resource is derived from the Oxford English Dictionary and is widely adopted by CEFR educators. It also guides beginner and advanced learners on what words they should know at each specific CEFR level (from A1 to C1). We use the expanded version with words and their associated CEFR levels to manually construct the test cases for evaluating the Target Audience constraint for SpeciaLex.
4.3 Prompt Construction
We followed the prompt construction process observed by LegalBench Guha et al. (2024) where, for each subtask, a base prompt is used containing random gold-standard demonstrations serving as in-context examples and a test file containing the manually constructed test instances with respect to the specific constraint and core task being evaluated by the subtask (e.g., Checking with Specific Roles as visualized in Figure 1). Each instance in the test file is appended to the base prompt for prompting an LLM to capture its output, which will then be evaluated with a task and constraint-appropriate method. Additional information and actual prompt templates can be found in Appendix D and F.
4.4 Evaluation
Our selection of automatic evaluation methods is based on discussions with domain experts and references to previous works. Additional information can be found in Appendix E.
Structured prediction and binary classification tasks from Checking and Identification are evaluated using exact-match accuracy as done in other LLM benchmarks Guha et al. (2024); Liang et al. (2023); Alex et al. (2021). For Rewriting and Open Generation tasks requiring a model to produce texts conforming to specific roles, special definitions, or words for a target audience, we use varying tools for resolving alignment. For conformity of a word based on a specific role through POS, we use Spacy666https://spacy.io/api/tagger implementation of a POS classifier for identifying the POS information of a target word. For judging whether a word has been used according to its approved definition, we use GPT-4 as a judge. Existing LLM benchmarks and chatbot arenas have used GPT-4 as a judge for its high performance across general and semantic-based tasks, and results have shown a significantly high level of agreement with human experts Zheng et al. (2024); Asai et al. (2023). For assessing texts based on a target audience, we developed a simple lexicon-matching script that sums the total unique content words (nouns, adjectives, adverbs, verbs) recognized by the target category (e.g., A2) and divided by the total words of the text. Thus, closer values to are better, entailing higher density of words recognized by the target audience.
4.5 Benchmark Statistics
Upon completion of the construction process, SpeciaLex contains a total of test instances distributed across subtasks from the core task category as reported in Table 1 and in Table 6. Subtasks contain test instances with a minimum of and a maximum of (average ). We note that these numbers are closely comparable to existing domain-adapted recent LLM benchmarks, including LegalBench Guha et al. (2024) and RAFT Alex et al. (2021) where the minimum number of tests instances are also set to 50.
LLMs | Checking | Identification | Rewriting | Open Generation | |||||||
ID1 | ID2 | ID3 | ID4 | ID5 | ID6 | ID7 | ID8 | ID9 | ID10 | ||
Gemma-2B | 0.46 | 0.50 | 0.68 | 0.54 | 0.49 | 0.51 | 0.26 | 0.61 | 0.62 | 0.63 | 0.54 |
OLMO-1B | 0.50 | 0.05 | 0.52 | 0.71 | 0.46 | 0.36 | 0.43 | 0.09 | 0.88 | 0.12 | 0.40 |
BLOOM-1B | 0.50 | 0.50 | 0.74 | 0.67 | 0.58 | 0.42 | 0.51 | 0.23 | 0.67 | 0.15 | 0.50 |
Llama3-8B | 0.56 | 0.81 | 0.74 | 0.86 | 0.10 | 0.63 | 0.17 | 0.03 | 0.32 | 0.07 | 0.42 |
Mistral-7B | 0.53 | 0.72 | 0.49 | 0.57 | 0.70 | 0.48 | 0.43 | 0.87 | 0.80 | 0.80 | 0.65 |
Llama2-7B | 0.50 | 0.50 | 0.43 | 0.71 | 0.70 | 0.67 | 0.41 | 0.83 | 0.73 | 0.78 | 0.64 |
Llama2-13B | 0.50 | 0.56 | 0.57 | 0.78 | 0.69 | 0.60 | 0.44 | 0.85 | 0.83 | 0.87 | 0.69 |
OLMO-7B | 0.38 | 0.64 | 0.49 | 0.67 | 0.60 | 0.57 | 0.39 | 0.80 | 0.67 | 0.76 | 0.62 |
Gemma-7B | 0.53 | 0.34 | 0.66 | 0.71 | 0.69 | 0.51 | 0.47 | 0.80 | 0.77 | 0.80 | 0.64 |
BLOOM-7B | 0.50 | 0.50 | 0.44 | 0.59 | 0.66 | 0.67 | 0.69 | 0.57 | 0.34 | 0.25 | 0.52 |
CommandR-105B | 0.53 | 0.89 | 0.75 | 0.88 | 0.27 | 0.57 | 0.38 | 0.88 | 0.91 | 0.87 | 0.71 |
Llama2-70B | 0.53 | 0.13 | 0.55 | 0.88 | 0.27 | 0.59 | 0.48 | 0.85 | 0.87 | 0.87 | 0.61 |
Llama3-70B | 0.69 | 0.91 | 0.83 | 0.94 | 0.29 | 0.59 | 0.50 | 0.92 | 0.93 | 0.91 | 0.76 |
GPT3.5-Turbo | 0.47 | 0.88 | 0.75 | 0.99 | 0.63 | 0.61 | 0.49 | 0.90 | 0.90 | 0.89 | 0.78 |
GPT-4o | 0.89 | 0.94 | 0.82 | 0.93 | 0.75 | 0.62 | 0.48 | 0.92 | 0.97 | 0.94 | 0.82 |
LLMs | Checking | Identification | Rewriting | Open Generation | |||||
ID11 | ID12 | ID13 | ID14 | ID15 | ID16 | ID17 | ID18 | ||
Gemma-2B | 0.49 | 0.31 | 0.00 | 0.23 | 0.68 | 0.68 | 0.69 | 0.69 | 0.47 |
BLOOM-1B | 0.85 | 0.84 | 0.00 | 0.21 | 0.69 | 0.69 | 0.71 | 0.72 | 0.59 |
Llama3-8B | 0.96 | 0.94 | 0.00 | 0.30 | 0.68 | 0.69 | 0.69 | 0.70 | 0.62 |
Mistral-7B | 0.68 | 0.52 | 0.02 | 0.11 | 0.70 | 0.69 | 0.65 | 0.65 | 0.50 |
Llama2-7B | 0.47 | 0.58 | 0.00 | 0.08 | 0.70 | 0.70 | 0.68 | 0.67 | 0.48 |
Llama2-13B | 0.66 | 0.45 | 0.02 | 0.09 | 0.70 | 0.70 | 0.70 | 0.71 | 0.50 |
OLMO-7B | 0.57 | 0.56 | 0.02 | 0.15 | 0.68 | 0.69 | 0.68 | 0.68 | 0.50 |
Gemma-7B | 0.02 | 0.02 | 0.00 | 0.00 | 0.05 | 0.05 | 0.02 | 0.01 | 0.02 |
BLOOM-7B | 0.66 | 0.66 | 0.02 | 0.30 | 0.68 | 0.67 | 0.72 | 0.72 | 0.55 |
CommandR-105B | 0.62 | 0.40 | 0.04 | 0.09 | 0.70 | 0.70 | 0.67 | 0.67 | 0.49 |
Llama2-70B | 0.23 | 0.15 | 0.00 | 0.15 | 0.70 | 0.70 | 0.72 | 0.71 | 0.42 |
Llama3-70B | 0.55 | 0.34 | 0.02 | 0.13 | 0.71 | 0.71 | 0.66 | 0.66 | 0.47 |
GPT3.5-Turbo | 0.57 | 0.34 | 0.02 | 0.09 | 0.71 | 0.71 | 0.66 | 0.66 | 0.47 |
GPT-4o | 0.62 | 0.79 | 0.03 | 0.08 | 0.71 | 0.71 | 0.65 | 0.65 | 0.53 |
5 Experiments with SpeciaLex
5.1 Models
For SpeciaLex, we evaluated a diverse family of publicly accessible instruction-tuned models available on Huggingface. For models within the range of 1B-2B, we explored Gemma Mesnard et al. (2024), OLMO Groeneveld et al. (2024), and BLOOM Le Scao et al. (2023). For models within the 7B to 13B, we included the Llama family Touvron et al. (2023a, b), Mistral Jiang et al. (2023), as well as the larger versions OLMO and Gemma. For even larger models, we explored the 70B of Llama2 and Llama3 as well as Cohere’s Command R with 105B. For commercial models, we explored GPT-3.5-Turbo and GPT-4o. Additional information on setup and hyperparameter can be found in Appendix B.
5.2 Performances on SpeciaLex’s Structured Prediction Tasks
We highlight a number of insights by observing the performances of LLMs for structured prediction and classification from Checking and Identification tasks reported in Table 2 and Table 3. We refer the reader to Table 6 in the Appendix A for the task number references throughout this section.
From the STE lexicon-based constraints, we see a straightforward trend in performance where the best models for capturing C1 and C2 are GPT-4o and GPT3.5-Turbo (ID1, ID2, and ID4). Llama3-70B has the closest runner-up performance for open models and obtains the best score for Identification with C1 (ID3). On the other hand, for the target audience constraint C3, the best-performing models are open models, where the mid-sized Llama3-8B model obtains the three highest performance for Checking with full and minimal conformity and Identification which the latter ties with BLOOM-1B (ID11, ID12, and ID14).
Through a paired -test, we find no significance (, ) in the performance difference of Llama3-70B against GPT-4o and GPT3.5-Turbo for Checking and Identification tasks capturing C1 and C2 constraints. Meanwhile, we do find significance with Llama3-8B against GPT-4o and GPT3.5-Turbo for target audience constraint C3 (, ) in favor of Llama3-8B a higher mean value ( > ). These findings suggest that open models like Llama3 can serve as strong, viable alternatives for content generation with structured lexicon-based constraints if commercial models are unavailable or not within funding capacity.
5.3 Performances on SpeciaLex’s Open-Ended Generation Tasks
We highlight a number of insights by observing the performances of LLMs for open-ended generation from Rewriting and Open Generation tasks as reported in Table 3 and Table 3.
Similar to the structured prediction tasks of Checking and Identification, we see favorable performances of commercial models GPT-4o and GPT-3.5-Turbo taking the top spots for Open Generation and Rewriting, particularly with on C1 and C2 constraints (ID8, ID9, and ID10) and on C1 and C3 with full and minimal conformity (ID15 and ID16). For open models, we see multiple models obtaining tied high performances. This includes Llama2-70B and BLOOM-7B together for Open Generation with full conformity (ID17), Llama3-70B and GPT-4o for Open Generation on C1 (ID8) and on Rewriting with C3 on full and minimal conformity (ID15 and ID16).
For the Rewriting and Open Generation tasks using STE lexicon-based constraints, we obtain no significance in performances of open models vs. commercial models (, ). On the other hand, for Rewriting and Open Generation tasks using target audience constraints, we arrive at a significance (, ) in favor of open models such as Llama3-70B with higher mean value ( > ). With this, we further strengthen our previous findings and conclude that open models like Llama2-70B, Llama3-70B, and BLOOM-7B remain competitive for controlled open-ended generation tasks as first-choice models regardless of access to closed commercial models.
5.4 Error Analysis on Low-Performance Tasks
We take a closer look at the tasks with generally poor performances from models. This is particularly evident for tasks in Table 3 specifically on both Idenfitication subtasks requiring listing words from a text that are not recognized within the target audience level (ID13) and identifying the correct level (ID14). For the former, upon manual error analysis of model outputs, LLMs evaluated for the subtask often provide an insufficient number of required words (e.g., only giving words while the required is ), which includes words that are already within the recognized target audience level. For the latter, we see a trend where LLMs tend to oversimplify their estimations to lower levels (e.g., the correct level is B2, but models will give A2 or A1). We find similar insights from previous works on instruction-tuned LLMs oversimplifying level estimations for in-context learning tasks Imperial and Tayyar Madabushi (2023). We reserve the improvement of LLM performance for these specific subtasks for future work.
![Refer to caption](x2.png)
![Refer to caption](x3.png)
6 A SpeciaLex Guide
In this section, we outline a number of important points for consideration to guide researchers in using SpeciaLex as a reference or an evaluation tool for specific domain data and constraints.
Do bigger models have better performance? It depends on the task. It is a common observation from empirical experiments with LLMs that the larger the scale, the higher the generalization and performance across diverse tasks Wei et al. (2022a, 2021); Brown et al. (2020). However, the choice of larger models may be expensive and impractical for domain adaptation, where performance on a limited set of tasks (or even a singular task) is often prioritized. Upon aggregating the mean results from Tables 2 and 3 of models with increasing scale in Figure 2, we see only favorable performance for larger models on STE-based constraints focused on specific POS and special definitions. In the case of using target audience constraint, we observe that even the 8B version of Llama3 is better than all other models tested. Thus, we recommend researchers consider the nature of the task first, as smaller models have empirically shown to be able to achieve comparable performance on select constraints.
Are open models good enough? Yes. While it is also a common notion that commercial models such as GPT-4 by OpenAI are popularly known and advertised as the go-to standard for general NLP tasks, we provide empirical evidence in this study that open models are equally as performant and can serve as a practical alternative for the research community. Revisiting our findings from Section 5, open models such as Llama3-8B and 70B are able to achieve comparable—if not higher in some cases–performances across the four core tasks based on mean scores.
Do high-quality training data and model recency matter? Yes. Model scale may not be the only signal of effectiveness for capturing lexicon-based constraints. We recommend weighing the quality of data used for training the LLMs and using the most recent model versions released by their research developers. We see this particular advantage in the Llama family models with T token count used for pre-training data as well as using high-quality data filters777https://ai.meta.com/blog/meta-llama-3/ powered by Llama2. With this advantage, Llama3 was able to achieve generally higher task performances in Specialex than Llama2. Likewise, we posit that Llama3’s recency among all the other models may have given certain advantages in terms of data quality through scoping more and larger published open-source datasets used for pre-training.
How many demonstrations do I need for ICL? Five is a good start. SpeciaLex benchmarks models via in-context learning since prompting and providing additional information and target output is the most common way of interacting and delegating tasks to LLMs. As such, we recommend starting with around five or more diverse demonstrations rather than a zero-shot method for lexicon-based constraints to maximize the effectiveness of in-context learning. We support this recommendation by exploring various few-shot techniques from the best-performing models for STE and CEFR-based constraints, as seen in Figure 3. From the experiment, we report that using the standard 5-shot setup done in the major experiments in Table 2
and 3 generally obtain better performance than its equivalent lower shot examples.
![Refer to caption](x4.png)
![Refer to caption](x5.png)
7 Conclusion
In this work, we introduced SpeciaLex, a benchmark for evaluating state-of-the-art LLMs in capturing specialized lexicon-based constraints for content generation tasks commonly prevalent across interdisciplinary areas such as education, technical writing, and engineering. We provided an in-depth and empirical exploration of model performance, including looking at the effects of model scale, openness, few-shot setup, and recency. Our findings support the use of open models such as Llama8-3B as good, competitive starting resources for the benchmark, which also serves as a step forward for accessible community adoption and springboarding to various domains.
Limitations
Application to Multilingual Domain. Our work, including the data resources we used for building SpeciaLex tasks and the LLMs we evaluated, mainly focuses on the English language. We do not claim that the performances of the models we reported in this paper will be comparable to tasks where the source of lexicon-based constraints is in a different language. Investigating the capabilities of LLMs in capturing multilingual lexicon-based constraints is a research opportunity left for future work.
Coverage of Non Lexicon-Based Constraints. For uniformity of experiment setups and achieving a centralized benchmark, our work specifically focuses on evaluating to what extent LLMs can capture lexicon-based constraints via in-context learning. Thus, we do not focus on evaluating rules beyond those covered by a specialized lexicon. For example, in Simple Technical English (STE), although not part of the lexicon, there are some additional recommended rules on phrasing, such as maintaining only one topic per paragraph or start an instruction with a descriptive statement (dependent phrase or clause). Upon recommendation by the experts we collaborated with, we did not include these rules in the experiment process.
Ethics Statement
This work used LLMs for the generation of texts to conform to lexicon-based constraints derived from Simple Technical English and Oxford 5000, which are existing publicly accessible expert-developed corpora provided proper acknowledgments. The prompts crafted for each subtask of the SpeciaLex benchmark are all derived from the two mentioned data sources and do not instruct the LLMs to explicitly nor implicitly produce harmful texts. Overall, we do not see any serious ethical implications from this work.
Acknowledgements
We would like to thank Brian North and Orlando Chiarello for the insightful discussions on capturing CEFR and ASD-STE standards used in this work. ASD-STE100 Simplified Technical English is a Copyright and a Trademark of ASD, Brussels, Belgium. This work made use of the Hex GPU cloud of the Department of Computer Science at the University of Bath. JMI is supported by the National University Philippines and the UKRI Centre for Doctoral Training in Accountable, Responsible and Transparent AI [EP/S023437/1] of the University of Bath.
References
- Alex et al. (2021) Neel Alex, Eli Lifland, Lewis Tunstall, Abhishek Thakur, Pegah Maham, C Jess Riedel, Emmie Hine, Carolyn Ashurst, Paul Sedille, Alexis Carlier, et al. 2021. RAFT: A Real-World Few-Shot Text Classification Benchmark. In Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track (Round 2).
- Asai et al. (2023) Akari Asai, Zeqiu Wu, Yizhong Wang, Avirup Sil, and Hannaneh Hajishirzi. 2023. Self-RAG: Learning to Retrieve, Generate, and Critique through Self-Reflection. In The Twelfth International Conference on Learning Representations.
- Brown et al. (2020) Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language Models are Few-Shot Learners. Advances in Neural Information Processing Systems, 33:1877–1901.
- Cai et al. (2024) Yan Cai, Linlin Wang, Ye Wang, Gerard de Melo, Ya Zhang, Yanfeng Wang, and Liang He. 2024. MedBench: A Large-Scale Chinese Benchmark for Evaluating Medical Large Language Models. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 38, pages 17709–17717.
- Chen et al. (2022) Yiran Chen, Zhenqiao Song, Xianze Wu, Danqing Wang, Jingjing Xu, Jiaze Chen, Hao Zhou, and Lei Li. 2022. MTG: A benchmark suite for multilingual text generation. In Findings of the Association for Computational Linguistics: NAACL 2022, pages 2508–2527, Seattle, United States. Association for Computational Linguistics.
- Chung et al. (2022) Hyung Won Chung, Le Hou, Shayne Longpre, Barret Zoph, Yi Tay, William Fedus, Eric Li, Xuezhi Wang, Mostafa Dehghani, Siddhartha Brahma, et al. 2022. Scaling Instruction-Finetuned Language Models. arXiv preprint arXiv:2210.11416.
- Eldan and Li (2023) Ronen Eldan and Yuanzhi Li. 2023. Tinystories: How small can language models be and still speak coherent english? arXiv preprint arXiv:2305.07759.
- Gehman et al. (2020) Samuel Gehman, Suchin Gururangan, Maarten Sap, Yejin Choi, and Noah A. Smith. 2020. RealToxicityPrompts: Evaluating neural toxic degeneration in language models. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 3356–3369, Online. Association for Computational Linguistics.
- Gehrmann et al. (2021) Sebastian Gehrmann, Tosin Adewumi, Karmanya Aggarwal, Pawan Sasanka Ammanamanchi, Anuoluwapo Aremu, Antoine Bosselut, Khyathi Raghavi Chandu, Miruna-Adriana Clinciu, Dipanjan Das, Kaustubh Dhole, Wanyu Du, Esin Durmus, Ondřej Dušek, Chris Chinenye Emezue, Varun Gangal, Cristina Garbacea, Tatsunori Hashimoto, Yufang Hou, Yacine Jernite, Harsh Jhamtani, Yangfeng Ji, Shailza Jolly, Mihir Kale, Dhruv Kumar, Faisal Ladhak, Aman Madaan, Mounica Maddela, Khyati Mahajan, Saad Mahamood, Bodhisattwa Prasad Majumder, Pedro Henrique Martins, Angelina McMillan-Major, Simon Mille, Emiel van Miltenburg, Moin Nadeem, Shashi Narayan, Vitaly Nikolaev, Andre Niyongabo Rubungo, Salomey Osei, Ankur Parikh, Laura Perez-Beltrachini, Niranjan Ramesh Rao, Vikas Raunak, Juan Diego Rodriguez, Sashank Santhanam, João Sedoc, Thibault Sellam, Samira Shaikh, Anastasia Shimorina, Marco Antonio Sobrevilla Cabezudo, Hendrik Strobelt, Nishant Subramani, Wei Xu, Diyi Yang, Akhila Yerukola, and Jiawei Zhou. 2021. The GEM benchmark: Natural language generation, its evaluation and metrics. In Proceedings of the 1st Workshop on Natural Language Generation, Evaluation, and Metrics (GEM 2021), pages 96–120, Online. Association for Computational Linguistics.
- Groeneveld et al. (2024) Dirk Groeneveld, Iz Beltagy, Pete Walsh, Akshita Bhagia, Rodney Kinney, Oyvind Tafjord, Ananya Harsh Jha, Hamish Ivison, Ian Magnusson, Yizhong Wang, et al. 2024. OLMo: Accelerating the Science of Language Models. arXiv preprint arXiv:2402.00838.
- Guha et al. (2024) Neel Guha, Julian Nyarko, Daniel Ho, Christopher Ré, Adam Chilton, Alex Chohlas-Wood, Austin Peters, Brandon Waldon, Daniel Rockmore, Diego Zambrano, et al. 2024. LEGALBENCH: A Collaboratively Built Benchmark for Measuring Legal Reasoning in Large Language Models. Advances in Neural Information Processing Systems, 36.
- Guo et al. (2023) Taicheng Guo, Bozhao Nan, Zhenwen Liang, Zhichun Guo, Nitesh Chawla, Olaf Wiest, Xiangliang Zhang, et al. 2023. What can Large Language Models do in chemistry? A comprehensive benchmark on eight tasks. Advances in Neural Information Processing Systems, 36:59662–59688.
- Hartvigsen et al. (2022) Thomas Hartvigsen, Saadia Gabriel, Hamid Palangi, Maarten Sap, Dipankar Ray, and Ece Kamar. 2022. ToxiGen: A large-scale machine-generated dataset for adversarial and implicit hate speech detection. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 3309–3326, Dublin, Ireland. Association for Computational Linguistics.
- He and Yiu (2022) Xingwei He and Siu Ming Yiu. 2022. Controllable dictionary example generation: Generating example sentences for specific targeted audiences. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 610–627, Dublin, Ireland. Association for Computational Linguistics.
- Hsueh-Chao and Nation (2000) Marcella Hu Hsueh-Chao and Paul Nation. 2000. Unknown vocabulary density and reading comprehension.
- Imperial and Tayyar Madabushi (2023) Joseph Marvin Imperial and Harish Tayyar Madabushi. 2023. Flesch or fumble? evaluating readability standard alignment of instruction-tuned language models. In Proceedings of the Third Workshop on Natural Language Generation, Evaluation, and Metrics (GEM), pages 205–223, Singapore. Association for Computational Linguistics.
- Jiang et al. (2023) Albert Q Jiang, Alexandre Sablayrolles, Arthur Mensch, Chris Bamford, Devendra Singh Chaplot, Diego de las Casas, Florian Bressand, Gianna Lengyel, Guillaume Lample, Lucile Saulnier, et al. 2023. Mistral 7B. arXiv preprint arXiv:2310.06825.
- Jin et al. (2019) Qiao Jin, Bhuwan Dhingra, Zhengping Liu, William Cohen, and Xinghua Lu. 2019. PubMedQA: A dataset for biomedical research question answering. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 2567–2577, Hong Kong, China. Association for Computational Linguistics.
- Kasneci et al. (2023) Enkelejda Kasneci, Kathrin Seßler, Stefan Küchemann, Maria Bannert, Daryna Dementieva, Frank Fischer, Urs Gasser, Georg Groh, Stephan Günnemann, Eyke Hüllermeier, et al. 2023. ChatGPT for Good? On Opportunities and Challenges of Large Language Models for Education. Learning and Individual Differences, 103:102274.
- Kew et al. (2023) Tannon Kew, Alison Chi, Laura Vásquez-Rodríguez, Sweta Agrawal, Dennis Aumiller, Fernando Alva-Manchego, and Matthew Shardlow. 2023. BLESS: Benchmarking large language models on sentence simplification. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pages 13291–13309, Singapore. Association for Computational Linguistics.
- Knezevic (2015) Jezdimir Knezevic. 2015. Improving quality of maintenance through Simplified Technical English. Journal of Quality in Maintenance Engineering, 21(3):250–257.
- Kuhn (2014) Tobias Kuhn. 2014. A survey and classification of controlled natural languages. Computational Linguistics, 40(1):121–170.
- Laufer (1989) Batia Laufer. 1989. 25 What Percentage of Text-Lexis is Essential for Comprehension? Special language: From humans thinking to thinking machines, page 316.
- Le Scao et al. (2023) Teven Le Scao, Angela Fan, Christopher Akiki, Ellie Pavlick, Suzana Ilić, Daniel Hesslow, Roman Castagné, Alexandra Sasha Luccioni, François Yvon, Matthias Gallé, et al. 2023. BLOOM: A 176B-Parameter Open-Access Multilingual Language Model .
- Li et al. (2023) Junyi Li, Xiaoxue Cheng, Xin Zhao, Jian-Yun Nie, and Ji-Rong Wen. 2023. HaluEval: A large-scale hallucination evaluation benchmark for large language models. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pages 6449–6464, Singapore. Association for Computational Linguistics.
- Liang et al. (2023) Percy Liang, Rishi Bommasani, Tony Lee, Dimitris Tsipras, Dilara Soylu, Michihiro Yasunaga, Yian Zhang, Deepak Narayanan, Yuhuai Wu, Ananya Kumar, et al. 2023. Holistic Evaluation of Language Models. Transactions on Machine Learning Research.
- Liang et al. (2020) Yaobo Liang, Nan Duan, Yeyun Gong, Ning Wu, Fenfei Guo, Weizhen Qi, Ming Gong, Linjun Shou, Daxin Jiang, Guihong Cao, Xiaodong Fan, Ruofei Zhang, Rahul Agrawal, Edward Cui, Sining Wei, Taroon Bharti, Ying Qiao, Jiun-Hung Chen, Winnie Wu, Shuguang Liu, Fan Yang, Daniel Campos, Rangan Majumder, and Ming Zhou. 2020. XGLUE: A new benchmark dataset for cross-lingual pre-training, understanding and generation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 6008–6018, Online. Association for Computational Linguistics.
- Mesnard et al. (2024) Thomas Mesnard, Cassidy Hardin, Robert Dadashi, Surya Bhupatiraju, Shreya Pathak, Laurent Sifre, Morgane Rivière, Mihir Sanjay Kale, Juliette Love, et al. 2024. Gemma: Open Models Based on Gemini Research and Technology. arXiv preprint arXiv:2403.08295.
- Muhlgay et al. (2024) Dor Muhlgay, Ori Ram, Inbal Magar, Yoav Levine, Nir Ratner, Yonatan Belinkov, Omri Abend, Kevin Leyton-Brown, Amnon Shashua, and Yoav Shoham. 2024. Generating benchmarks for factuality evaluation of language models. In Proceedings of the 18th Conference of the European Chapter of the Association for Computational Linguistics (Volume 1: Long Papers), pages 49–66, St. Julian’s, Malta. Association for Computational Linguistics.
- Pal et al. (2022) Ankit Pal, Logesh Kumar Umapathi, and Malaikannan Sankarasubbu. 2022. MedMCQA: A Large-scale Multi-Subject Multi-Choice Dataset for Medical domain Question Answering. In Proceedings of the Conference on Health, Inference, and Learning, volume 174 of Proceedings of Machine Learning Research, pages 248–260. PMLR.
- Radford et al. (2018) Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. 2018. Improving language understanding by generative pre-training.
- Radford et al. (2019) Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. 2019. Language Models are Unsupervised Multitask Learners. OpenAI Blog, 1(8):9.
- Röttger et al. (2023) Paul Röttger, Hannah Rose Kirk, Bertie Vidgen, Giuseppe Attanasio, Federico Bianchi, and Dirk Hovy. 2023. XSTest: A Test Suite for Identifying Exaggerated Safety Behaviours in Large Language Models. arXiv preprint arXiv:2308.01263.
- Sun et al. (2023) Jiao Sun, Yufei Tian, Wangchunshu Zhou, Nan Xu, Qian Hu, Rahul Gupta, John Wieting, Nanyun Peng, and Xuezhe Ma. 2023. Evaluating large language models on controlled generation tasks. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pages 3155–3168, Singapore. Association for Computational Linguistics.
- Touvron et al. (2023a) Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, et al. 2023a. LLaMA: Open and Efficient Foundation Language Models. arXiv preprint arXiv:2302.13971.
- Touvron et al. (2023b) Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, et al. 2023b. Llama 2: Open Foundation and Fine-Tuned Chat Models. arXiv preprint arXiv:2307.09288.
- Wei et al. (2021) Jason Wei, Maarten Bosma, Vincent Zhao, Kelvin Guu, Adams Wei Yu, Brian Lester, Nan Du, Andrew M Dai, and Quoc V Le. 2021. Finetuned Language Models are Zero-Shot Learners. In International Conference on Learning Representations.
- Wei et al. (2022a) Jason Wei, Yi Tay, Rishi Bommasani, Colin Raffel, Barret Zoph, Sebastian Borgeaud, Dani Yogatama, Maarten Bosma, Denny Zhou, Donald Metzler, et al. 2022a. Emergent Abilities of Large Language Models. Transactions on Machine Learning Research.
- Wei et al. (2022b) Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Fei Xia, Ed Chi, Quoc V Le, Denny Zhou, et al. 2022b. Chain-of-Thought Prompting Elicits Reasoning in Large Language Models. Advances in Neural Information Processing Systems, 35:24824–24837.
- Wu et al. (2022) Patrick Y. Wu, Richard Bonneau, Joshua A. Tucker, and Jonathan Nagler. 2022. Dictionary-assisted supervised contrastive learning. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 10217–10235, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics.
- Yu et al. (2022) Wenhao Yu, Chenguang Zhu, Yuwei Fang, Donghan Yu, Shuohang Wang, Yichong Xu, Michael Zeng, and Meng Jiang. 2022. Dict-BERT: Enhancing language model pre-training with dictionary. In Findings of the Association for Computational Linguistics: ACL 2022, pages 1907–1918, Dublin, Ireland. Association for Computational Linguistics.
- Zheng et al. (2024) Lianmin Zheng, Wei-Lin Chiang, Ying Sheng, Siyuan Zhuang, Zhanghao Wu, Yonghao Zhuang, Zi Lin, Zhuohan Li, Dacheng Li, Eric Xing, et al. 2024. Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena. Advances in Neural Information Processing Systems, 36.
- Zhou et al. (2023) Wangchunshu Zhou, Yuchen Eleanor Jiang, Ethan Wilcox, Ryan Cotterell, and Mrinmaya Sachan. 2023. Controlled text generation with natural language instructions. In Proceedings of the 40th International Conference on Machine Learning, volume 202 of Proceedings of Machine Learning Research, pages 42602–42613. PMLR.
Appendix A Appendix
In the following sections, we provide additional information, such as examples and statistics regarding the datasets, experiment procedures, and tasks used for building the SpeciaLex benchmark.
Appendix B Model Hyperparamter and Generation Setting
Implementation-wise, we used Huggingface’s Inference API (https://huggingface.co/inference-api/serverless) and Text Generation Pipeline for these models and set temperature to for all tasks in line with the deterministic nature and max tokens to for Rewriting and Open Generation tasks. For running the models for inference, we used our university’s GPU cloud server with 8 NVIDIA GeForce RTX 3090 with 24GB memory size. For closed commercial models, we evaluated GPT3.5-Turbo and GPT-4o for comparison with a January 25 and May 2024 knowledge cutoff, respectively, using OpenAI’s API (https://openai.com/api/). We omit OLMO-1B in Table 3 due to the generation of gibberish texts for this setup.
Appendix C Additional Information on Datasets
C.1 Oxford 5000
We provide additional statistical information regarding the Oxford 5000 lexicon used for SpeciaLex. Table 4 shows the breakdown of the number of unique words associated per target audience level of the CEFR scale used for Oxford 5000. Since the nature of CEFR is ordinal in practice (e.g., a B1 learner recognizes words from previous levels such as A2 and A1), we combined the words per category successively when evaluating for density of content words in the custom lexicon-matching script done from the experiments in Table 3. We also provide an example of words that experts found to be recognizable per target audience level in Table 7.
A1 | A2 | B1 | B2 | C1 | |
---|---|---|---|---|---|
Count | 897 | 867 | 838 | 1,422 | 1,311 |
% | 16.8 | 16.5 | 15.7 | 26.6 | 24.5 |
C.2 STE
We provide additional statistical information regarding the Simple Technical English (STE) lexicon used for SpeciaLex. Table 5 shows the breakdown of original words, it’s a corresponding recommended alternative with correct role or POS information, and words with special definitions per POS category recognized by the lexicon. As such, the data from the first two columns were used for building the tasks for C1 - Specific Role and the third for C2 - Special Definition. For this study, we used the 2017 version provided by the STEMG representatives we collaborated with, which is the previous version to the current 2021 version available to download from the official website (https://www.asd-ste100.org/). This is due to embargo restrictions on machine-readable copies. Furthermore, we obtained explicit permission from the STEMG representatives to share the transformed version of the STE lexicon with respect to benchmark tasks to be shared as a research artifact of this work.
POS | Original | Alternative | Special Def |
---|---|---|---|
NOUN | 212 | 276 | 243 |
VERB | 648 | 590 | 235 |
ADP | 27 | 39 | 49 |
ADJ | 269 | 247 | 254 |
ADV | 85 | 80 | 118 |
SCONJ | 12 | 22 | 18 |
PRON | 6 | 4 | 19 |
Appendix D Additional Information on Constructing Prompts for Tasks
For tasks covering C1 - Specific Role and C2 - Special Definition, the information required to build the prompts for their associated tasks was all derived from what is available in the STE lexicon as seen in Table 8 and Table 9. For example, for Task ID5, we want to prompt an LLM to rewrite a sentence so that the target word is replaced by its STE-approved alternative and POS information. Thus, we only need to get data from the incorrect sentence column, the target word column and its POS, and the approved word column and its POS to build the prompt, which we can see in Figure 10.
For tasks covering C3 - Target Audience, unlike STE, Oxford 5000, the lexicon does not come with pre-compiled examples of stories conforming to each specific target audience level. Thus, we use an external data source for this, which is the TinyStories corpus Eldan and Li (2023), which is a GPT-4 generated compilation of short stories. The selection of this corpus is due to its recency and obtaining high qualitative evaluation in terms of consistency, grammar, creativity, and plot by human annotators Eldan and Li (2023). Using our custom lexicon-matching script, we select entries from the TinyStories corpus that fit each target audience category in the CEFR levels recognized by the Oxford 5000 lexicon and use them according to task requirements. For example, in Task ID14 in Figure 18, we used TinyStories entries classified under different CEFR levels to prompt an LLM to guess their correct CEFR level, given a few examples for in-context learning. Another example in Task ID15 in Figure 19, we prompt an LLM to rewrite the story to a target lower or higher audience level.
Appendix E Additional Information on Evaluation Methods
We provide additional information about the evaluation methods used for the constraints. For the C2 - Special Definition constraint where GPT-4 is used as the judge, we use the following prompt template below:
For the C3 - Target Audience constraint, the formula used for the lexicon-matching script is as follows:
(1) |
where denotes each content word from the text being evaluated for occurrence in the set of words recognized by the target audience level (e.g., A2) and normalized by the total number of words of the text. is an indicator function that counts for each match. As mentioned, closer values to are better since they denote texts with a higher density of words recognized by the specific target audience level.
Appendix F Task Prompt Templates
We provide the base prompt templates used for each task from SpeciaLex in the last portion of this document from Figures 5 to 22. The templates were adopted from previous benchmark tasks such as LegalBench Guha et al. (2024) and RAFT Alex et al. (2021) where few-shot examples are also used for in-context learning. The template visualizations are color-coded with respect to the task: Teal for Checking, Purple for Idenfitication, Violet for Rewriting, and Cyan for Open Generation.
ID | Task Description | Task | Constraint | Corpora | Evaluation | Instances |
---|---|---|---|---|---|---|
1 | Given a word and a text, check if the word is used according to its approved POS. | T1 | C1 | STE | Exact Acc | 72 |
2 | Given a word and a text, check if the word is used according to its approved definition. | T1 | C2 | STE | Exact Acc | 64 |
3 | Given a text, identify the word that is incorrectly used according to approved definition. | T2 | C1 | STE | Exact Acc | 69 |
4 | Given a text, identify the word that is incorrectly used according to approved POS. | T2 | C2 | STE | Exact Acc | 77 |
5 | Given a text and a word, rewrite the text so that the word is replaced by its approved substitute and POS. | T3 | C1 | STE | POS Evaluator | 300 |
6 | Given a text and a word, rewrite the text so that the word is replaced by its approved substitute and definition. | T3 | C2 | STE | GPT-4 | 82 |
7 | Given a text and a word, rewrite the text so that the word is used according to its approved substitute, definition, and POS. | T3 | C1, C2 | STE | POS Evaluator, GPT-4 | 67 |
8 | Given a word, generate a text where the word is used according to its approved POS. | T4 | C1 | STE | POS Evaluator | 175 |
9 | Given a word, generate a text where the word is used according to its approved definition. | T4 | C2 | STE | GPT-4 | 175 |
10 | Given a word, generate a text where the word is used according to its approved definition and POS. | T4 | C1, C2 | STE | POS Evaluator, GPT-4 | 175 |
11 | Given a text and a target audience via a category, check if all words in the text that occur within the category. | T1 | C3 | Oxford 5000 | Exact Acc | 53 |
12 | Given a text and a target audience via a category, check if 95% of content words in the text occur within the category. | T1 | C3 | Oxford 5000 | Exact Acc | 62 |
13 | Given a text and target audience via a category, identify all words in the text that occur beyond the category. | T2 | C3 | Oxford 5000 | Exact Acc | 55 |
14 | Given a text, identify the correct target audience via selecting a category. | T2 | C3 | Oxford 5000 | Exact Acc | 53 |
15 | Given a text and a target audience via a category, rewrite the text where all of its content words belong to the category. | T3 | C3 | Oxford 5000 | Dictionary Match | 53 |
16 | Given a text and a target audience via a category, rewrite the text where at least 95% of its content words belong to the category. | T3 | C3 | Oxford 5000 | Dictionary Match | 53 |
17 | Given a topic prompt and a target audience via a category, generate a text where all of its content words belong to the category | T4 | C3 | Oxford 5000 | Dictionary Match | 100 |
18 | Given a topic prompt and a target audience via a category, generate a text where at least 95% of its content words belong to the target. | T4 | C3 | Oxford 5000 | Dictionary Match | 100 |
A1 | A2 | B1 | B2 | C1 |
---|---|---|---|---|
above | asleep | absolutely | accurate | abolish |
across | appear | academic | acknowledge | accumulation |
ask | average | achievement | acquire | activist |
big | behavior | battery | blind | battlefield |
bike | blood | border | broadcast | biography |
cake | celebrity | careless | bacteria | bureaucracy |
call | coast | concentrate | commission | classification |
cold | complain | countryside | complicated | collaboration |
dark | designer | documentary | contemporary | configuration |
day | disaster | disadvantaged | deeply | destructive |
dear | disease | discount | deliberate | detection |
egg | engineer | environmental | dishonest | deteriorate |
eat | experience | exchane | emphasize | electoral |
ear | experiment | frightened | examination | empirical |
face | fortunately | friendship | fundamental | favorable |
fast | furniture | headache | facility | forthcoming |
fish | foreign | hockey | landscape | ideological |
fire | fiction | lorry | logical | ironically |
girl | government | loudly | military | legislative |
hair | hero | lifestyle | minister | literacy |
half | habit | possibility | mysterio | mainstream |
high | international | poster | nevertheless | mobilize |
juice | invention | profile | nightmare | niche |
learn | mathematics | reception | occassionally | newsletter |
laugh | manager | relationship | obligation | nonsense |
Word | POS | Alternative | POS | Approved Example | Incorrect Example |
---|---|---|---|---|---|
abandon | VERB | stop | VERB | Stop the engine start procedure. | Abandon engine start. |
abate | VERB | decrease | VERB | When the wind speed decreases to less than 30 knots, you can open the cargo door. | When the wind abates to less than 30 knots, you can open the cargo door. |
abnormality | NOUN | defect | NOUN | Examine the seal for defects. | Examine the seal for abnormalities. |
bank | VERB | bank | NOUN | The V-bars give the indication for a bank. | V-Bars indicate command to bank. |
bolt | VERB | bolt | NOUN | Attach the track to the channels with the bolts. | Bolt track to channels. |
break | NOUN | stop | VERB | If the transmission stops, cancel the test. | If there is a break in transmission, cancel the test. |
calculation | NOUN | calculate | VERB | In this example, we only calculated the data applicable to a type B unit. | The data used for the calculations in this example apply only to a Type B unit. |
care | NOUN | precaution | NOUN | Obey the safety precautions when you do work with high voltages. | You must take care when you work with high voltages. |
centralize | VERB | center | NOUN | Set the controls to the center position. | Centralize the controls. |
destroy | VERB | unserviceable | ADJ | Make the container unserviceable to make sure that you cannot use it again. | To avoid further use, destroy the container. |
double | ADJ | two | NOUN | You must see two marks on the stand. | Double marks must appear on the stand. |
earth | VERB | ground | VERB | Make sure that the fuel tanks are correctly grounded. | Make sure the fuel tanks are correctly earthed. |
emit | VERB | from | ADP | The fumes from this material are dangerous to the skin. | The vapors that this material emits are dangerous to the skin. |
factor | NOUN | cause | VERB | There can be many causes for corrosion. | Corrosion can be caused by several factors. |
fatal | ADJ | kill | VERB | High voltage in the electronic system can kill you. | High voltage in the electronic system can be fatal. |
finish | VERB | complete | VERB | Complete the test. | Finish the test. |
gash | VERB | damaged | ADJ | If the thermal blanket is damaged, do repair no. 9. | If the thermal blanket is gashed, do repair No. 9. |
gloss | NOUN | shiny | ADJ | Polish the surface until it is very shiny. | Polish the surface to a high gloss. |
hold | NOUN | hold | VERB | Make sure that you hold the rod tightly. | Make sure that you have a tight hold on the rod. |
impression | NOUN | think | VERB | If you think that a tire has low pressure, do the steps that follow: | If you have the impression that a tire has low pressure, do the steps that follow. |
incline | NOUN | slope | NOUN | You can adjust the slope of the ramp. | You can adjust the incline of the ramp. |
loop | VERB | loop | NOUN | Make a loop of wire around the unit. | Loop the wire around the unit. |
lose | VERB | decrease | VERB | The effect of the solvent decreases quickly. | The solvent loses its effectiveness quickly. |
mark | VERB | identify | VERB | Identify the component with a code to help you to install it again correctly. | Mark the component with a code that will facilitate its correct reinstallation. |
medium | ADJ | moderate | ADJ | Apply moderate pressure. | A medium amount of pressure must be applied. |
Word | POS | Approved Definition | Approved Example |
---|---|---|---|
abrasive | ADJ | that can remove material by friction | Dust, when mixed with oil, has an abrasive effect. |
accept | VERB | to make a decision that something is satisfactory | Accept the relay if it is serviceable. |
aft | ADJ | nearer to the rear of an air or sea vehicle | The pump is in the aft cell of the fuselage tank. |
bend | NOUN | the area where something is bent | Examine the bends for cracks. |
bleed | VERB | to let a gas out of | Bleed the speedbrake hydraulic system. |
bond | VERB | to make an electrical bond | The static discharger is electrically bonded to the frame. |
can | VERB | helping verb that means to be possible, to be able to, or to be permitted to | A mixture of fuel and oxygen can cause an explosion. |
control | NOUN | something that controls | Use the manual control in an emergency. |
device | NOUN | something used to do a task | Install the safety devices. |
dim | ADJ | not bright | During night operation, make sure that the panel lights are dim. |
divide | VERB | to separate into parts or groups | You can divide the drains into three primary groups. |
edge | NOUN | a line that is the intersection of two surfaces of a solid object | The distance between the edge of the panel and the partition must not be more than 0.05 mm. |
engage | VERB | to correctly align and come together | Engage the clutch. |
explosive | ADJ | that can cause an explosion | The safety precautions that follow are applicable to explosive items. |
finger-tighten | VERB | tighten with your fingers | Tighten the nut with your fingers. |
flange | NOUN | an end surface at an angle | Make sure that the flange is not damaged. |
groove | NOUN | a long channel that is not wide | Clean the groove with trichloroethane. |
ground | VERB | to connect to the ground or to a large object of zero potential | Ground the fuel tanks. |
inboard | ADJ | Nearer to the longitudinal axis | Remove the inboard fairing of the flap hinge. |
inflate | VERB | to make or become larger as a result of pressurization by gas | Inflate the tires with nitrogen. |
last | ADJ | that comes at the end | Immediately after the last flight of the day, install all covers. |
level | ADJ | horizontal to a known datum | Park the aircraft on level ground. |
light | VERB | come on | Make sure that the fluid indicator light comes on. |
mark | NOUN | something that you make or is made to show an identification, location, or direction | The red marks show a maximum steering angle of 35 degrees. |
monitor | VERB | to look at something for a period to see if there is a change. | Monitor the indicators on the overhead panel. |