Grammar Control for Language Learning with Sequential Monte Carlo and Small Language Models
Organizations: University of Göttingen · CHI-FRO · MIT · ETH Zürich ·
Abstract
Second language learners benefit from exposure to level-appropriate grammar in interactive language use. While prompted frontier language models can usually produce target grammar structures, less resource-intensive models that can be run on device often fail in this task. We use sequential Monte Carlo (SMC) to steer dialogue turn generation in small lan- language models toward target grammar constructions from an expert-developed pedagogical resource. With a minimal set of hand-coded potential functions, SMC achieves near-perfect coverage of target grammar, enabling small models to outperform state-of-the-art results from models 140 times larger. We also use code synthesis with frontier models to generate new potentials, showing that our method scales to hundreds of target grammar skills with no need for additional training or supervised data.
Figures & tables
| ID (CEFR) | Can-do statement, describing grammar skill | Examples of correct target use in English learner corpora |
|---|---|---|
| 258 (A1) | FORM: PHRASE + PHRASE Can use single word conjunctions (‘and, but, or’) to combine phrases. | My home is very light and very comfortable. I live with my mother and her boyfriend. My house is small but very nice. |
| 262 (A1) | USE: ‘BUT’ , CONCESSIVE Can use ‘but’ to add an unexpected contrast. | I really like my home, it is very small but it is very easy to clean. I like my home, it’s small but so comfortable. |
| 265 (B1) | FORM/USE: ‘PLUS’ WITH CLAUSES Can use ‘plus’ to connect clauses and sentences, often to point out a positive addition or advantage. | I would be more than pleased to receive you at home, it’s not too big, but we could have a lot of fun, plus you won’t have to pay a thing! It will be fun because everyone is going to be there. Plus, the park is the best place for a picnic, we can run and just have fun! |
| Prompt style | Prompt |
|---|---|
| B (Basic) | You are a friendly English tutor. I want to practice by ’Discussing enjoyable hobbies’. |
| T (Template) | I am a beginner English student. I want to practice patterns with to and -ing by Discussing hobbies with ‘enjoy + ing’. I want to ensure that I can use ‘enjoy’ followed by the ‘-ing’ form. For example, ‘I enjoy eating, I enjoy doing, I enjoy going…’. Let’s do a Q&A exercise. You (the AI) are a friendly English tutor. Tell me What you enjoy doing. Then ask me the same with short questions. (‘I enjoy reading. What do you enjoy doing?’, ‘When I go out I enjoy dancing. How about you?’) |
| Glandorf et al. | Number of Constraints | Average Quality Rating | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 6 | Mean | App. | C.R. | G.C. | Rel. | ||
| Llama 3.1 8B | 70.6 | 62.0 | 48.0 | 46.5 | 42.0 | 53.8 | 4.45 | 4.35 | 2.90 | 4.92 | |
| + fine-tuning | 76.0 | 61.5 | 49.3 | 49.2 | 44.7 | 56.2 | 4.09 | 3.98 | 2.29 | 4.70 | |
| + decoding | 81.6 | 72.2 | 65.7 | 60.8 | 65.3 | 69.1 | 4.31 | 4.27 | 2.80 | 4.87 | |
| + both (hybrid) | 86.5 | 69.8 | 66.7 | 60.0 | 59.5 | 68.5 | 3.45 | 3.32 | 2.02 | 4.13 | |
| SMC (Ours) | Particles | ||||||||||
| Proficiency Level (CEFR) | A1 | A2 | B1 | B2 | C1 | C2 | |
|---|---|---|---|---|---|---|---|
| Number of grammar skills | 109 | 288 | 338 | 242 | 129 | 112 | |
| GPT-4o-mini | One-shot accuracy | 84.1 | 76.9 | 77.4 | 69.5 | 77.3 | 73.8 |
| Planner for Llama 3.1 8B SMC (16) | 86.0 | 79.6 | 76.7 | 70.0 | 79.0 | 65.9 | |
| GPT-5.4 | One-shot accuracy | 95.4 | 97.3 | 96.5 | 96.6 | 93.8 | 95.8 |
| Planner for Llama 3.1 8B SMC (16) | 88.7 | 81.2 | 81.6 | 72.2 | 80.1 | 74.6 |
Appendix figures & tables17 assets
Supplementary material from the paper’s appendix.
Appendix
| EGP entry | Potential function | |||
|---|---|---|---|---|
| EGP ID | Can-do statement | Examples | .prefix() | .complete() |
| 115 | Can use a range of degree adverbs to modify common gradable adjectives. | I’m so happy because you can come! It’s really important for me, because I need to do some homework. | Reduce penalty for degree adverb (really, very, so, too, quite, extremely, pretty). | String contains some adjective ( tag_ = ADJ ) with a dependent degree adverb ( dep_ = advmod ). |
| 786 | Can use the affirmative form with an increasing range of verbs. | I forgot to tell you some details about tomorrow. I spent about £35 on all those clothes. | Reduce penalty for past-verb-like string ( [a-zA-Z]+ed , was, were, went, got, …). | String contains token with tag_ = VBD . |
| 874 | Can use the present simple with adverbs of indefinite frequency. | People usually try to eat their breakfast before 9 am. They always make special things for their celebrations. | Reduce penalty for frequency adverb (usually, sometimes, always, often, never, rarely, seldom, frequently). | String contains some present-tense main verb ( tag_ = {VBP,VBZ,VB} ) with a dependent frequency adverb ( dep_ = advmod ). |
| 930 | Can use it as an empty subject in subject position, particularly with weather or time. | It’s warm and windy. Now it’s 3 pm. | Reduce penalty for it and it + (is/was/’s) . | String contains token with lemma = be and dependent it ( dep_ = nsubj ). |
| 1082 | Can use enjoy followed by the -ing form. | We enjoy playing the piano and singing together. You know I really enjoy listening to music. | Reduce penalty for enjoy and enjoy + word+ing . | String contains enjoy with some verb gerund ( tag_ = VBG ) as head or dependent. |
| Prompt style | Study | Prompt |
|---|---|---|
| B (Baseline) | Ribeiro-Flucht et al. (2025) | You are a friendly English tutor. I want to practice by ’Discussing enjoyable hobbies’. Please use direct, short and simple sentences and easy words. Output only your next turn. Now let’s naturally start our conversation. User: Hello! System: |
| B (Basic) | Ours | You are a friendly English tutor. I want to practice by ‘Discussing hobbies with ‘enjoy + ing”. Please use direct, short and simple sentences and easy words. Output only your next turn. Now let’s naturally start our conversation. User: Hello! Tell me about yourself and the topic, and then ask about me. |
| P (Prompt) | Ribeiro-Flucht et al. (2025) | I am a beginner English student. I want to practice patterns_with to and -ing by Discussing hobbies with ’enjoy + ing’. I want to ensure that I can use ’enjoy’ followed by the ’-ing’ form. For example, ’I enjoy eating, I enjoy doing, I enjoy going…’. Let’s do a Q&A exercise. You (the AI) are a friendly English tutor. Tell me What you enjoy doing. Then ask me the same with short questions. (’I enjoy reading. What do you enjoy doing?’, ’When I go out I enjoy dancing. How about you?’) Please use direct, short and simple sentences and easy words. Output only your next turn. Now let’s naturally start our conversation. User: Hello! System: |
| T (Template) | Ours | I am a A2 English student. I want to practice enjoy + ing pattern (FORM: ‘ENJOY’ + ‘-ING’) by Discussing hobbies with ‘enjoy + ing’. I want to ensure that I can use ‘enjoy’ followed by the ‘-ing’ form.. For example, I enjoy eating, I enjoy doing, I enjoy going…. Let’s do a Q&A exercise. You (the AI) are a friendly English tutor. Tell me What you enjoy doing. Then ask me the same with short questions. (‘I enjoy reading. What do you enjoy doing?’, ‘When I go out I enjoy dancing. How about you?’) Please use direct, short and simple sentences and easy words. Output only your next turn. Now let’s naturally start our conversation. User: Hello! Tell me about yourself and the topic, and then ask about me. |
| Can-do statement | Modeling Setup | Generated Text | GPT-5-nano | Claude Haiku 4.5 | Gold |
|---|---|---|---|---|---|
| Can use a range of degree adverbs to modify common gradable adjectives. | Llama 3.1 8B, , B, A2 | My house is big and white. It has a long, bright front door. The garden is very green and clean. | ✓ | ✗ | ✓ |
| Can use the affirmative form with an increasing range of verbs. | Llama 3.2 1B, , B, A2 | Yesterday, I was at school. | ✓ | ✗ | ✓ |
| Can use a range of degree adverbs to modify common gradable adjectives. | Llama 3.1 8B, , B, A2 | I’m an English teacher. I teach students how to read, write, and speak English very well and clearly. | ✗ | ✓ | ✗ |
| Can use enjoy followed by the -ing form. | Qwen 2 1.5B, , B, A2 | Certainly! […] How about going to the beach for a day? It’s a great way to relax and enjoy the sun. […] | ✗ | ✓ | ✗ |
| Can use enjoy followed by the -ing form. | Llama 3.2 1B, , B, any | […] I’ll respond with the next part of the question in “enjoying” + “ing”. | ✓ | ✗ | ✗ |
| Can use the affirmative form with an increasing range of verbs. | Llama 3.2 1B, , T, A2 | I used to play with balls in a park. | ✗ | ✓ | ✓ |
| WHAT IS THE GOAL OF THIS STUDY AND WHAT WILL I DO? This evaluation study is conducted by researchers at ETH Zürich, Saarland University, and other partner universities. [Grammar] The goal is to evaluate whether short English texts contain specific grammatical patterns relevant to language learning. You were invited because you are a fluent English speaker. If you choose to participate, you will read brief example sentences written by second language learners of English, showing correct usage of a target grammatical pattern. You will then judge whether a second text generated by a language model contains the same grammatical pattern. Note that the English learner example sentences demonstrate the specific target grammar form correctly, but may be awkward or ungrammatical in other ways. Each judgment should take only a few seconds. The full study should take about 10–15 minutes. You will be compensated through Prolific. There are no risks associated with your participation. [Quality] The goal is to evaluate the quality of short English texts generated by language models. You will rate generated texts on 1–5 scales. The full study should take about 10–15 minutes. You will be compensated through Prolific. USE OF YOUR DATA [Grammar] We will ask for your Prolific ID and your yes/no judgments only. We do not collect personally identifying information. [Quality] We will ask for your Prolific ID and your quality ratings only. Data will be anonymised and may be published for research purposes. IF YOU WISH TO WITHDRAW You may leave the study at any time on Prolific. If you withdraw before completing the study, your data will be deleted and you will not receive payment. |
| Instructions [Grammar] You will see many short items like the practice items on the next pages. For each item: 1. Read the two example sentences produced by learners of English as a second language. 2. Read the generated text. 3. Answer Yes if the generated text contains at least one instance of the target grammar pattern; otherwise answer No . You can press Y or F for Yes and N or J for No on your keyboard. Answer from your own judgment only. Do not use translation tools, dictionaries, search engines, or AI assistants (including ChatGPT). These items are designed to be answered quickly. Work at a steady pace and do not overthink individual items. [Quality] You will rate the quality of generated English texts on scales from 1 to 5. In the first section, give one appropriateness rating per text. In the second section, give four ratings per text: Appropriateness, Relevance, Content Richness, and Grammatical Correctness. Click a numbered button, or press a number key from 1 to 5 . You can also use C, V, B, N, M for ratings 1, 2, 3, 4, and 5. Each response is recorded immediately. Answer from your own judgment only. Do not use translation tools, search engines, or AI assistants. |
| Target-grammar coverage (%) | ||||||||
| Experiment | Model | Prompt | ||||||
| 1 | Llama 3.1 8B | B | 32.0 | 46.4 | 60.8 | 72.8 | 60.8 | 64.0 |
| T | 92.8 | 92.8 | 92.0 | 94.4 | 96.8 | 90.4 | ||
| Llama 3.2 1B | B | 17.6 | 47.2 | 64.0 | 76.8 | 78.4 | 86.4 | |
| T | 56.8 | 80.0 | 89.6 | 92.0 | 91.2 | 98.4 | ||
| Qwen 2 0.5B | B | 12.8 | 28.8 | 31.2 | 56.8 | 64.8 | 84.0 | |
| Experiment | Model | Peak memory (GiB) | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | Llama 3.1 8B | Host RSS | 5.64 | 5.59 | 5.35 | 5.21 | 5.28 | 5.50 |
| GPU VRAM | 15.84 | 16.95 | 19.66 | 26.23 | 39.44 | 39.08 | ||
| Qwen 2 0.5B | Host RSS | 1.90 | 1.81 | 1.85 | 1.99 | 1.99 | 2.34 | |
| GPU VRAM | 1.60 | 2.00 | 2.78 | 15.45 | 8.91 | 35.54 | ||
| 2 | Llama 3.1 8B | Host RSS | 5.48 | 5.53 | 4.88 | 5.59 | 5.10 | 5.67 |
| GPU VRAM | 16.55 | 19.05 | 24.23 | 38.91 | 39.36 | 39.16 |
| Experiment | Model | Tested | Quantization | ||||||
|---|---|---|---|---|---|---|---|---|---|
| 1 | Qwen 2 0.5B | SMC | None | 2.31 | 2.07 | 2.72 | 2.95 | 3.36 | 4.96 |
| 2 | Qwen 2 0.5B | SMC | None | 2.34 | 2.41 | 2.96 | 4.63 | 3.71 | 7.49 |
| 1 | Llama 3.1 8B | standard baseline | Q4_K_M | 7.87 | 7.92 | 7.98 | 8.18 | 8.46 | 9.00 |
| SYSTEM: Only output A’s response. |
| USER: Given the dialog, write a possible next turn of A that includes all of these grammatical items: • negation—FORM: QUESTIONS: Can use negative question forms in main clauses and question tags. questions (CEFR B1) • superlatives—FORM/USE: COMPLEX NOUN PHRASES: Can form a limited range of complex noun phrases with a superlative adjective + prepositional phrase, to talk about something unique. noun phrases clauses: comparison (CEFR A2) • would—USE: WISHES AND PREFERENCES: Can use would with a wide range of verbs to talk about wishes and preferences. (CEFR A2) |
| Dialog: A: Hello have you seen the shape of water? B: No, have you? A: Yes, it’s a fantasy/drama film, it’s really good B: Yeah? Who directed it again? |
| Grammar target | Unrestricted vocabulary | A2 vocabulary |
|---|---|---|
| Degree adverb + adjective | 1. I love ice cream. I think it’s extremely cold and very sweet. What about burgers? Do you think burgers are quite big? 2. I have two very nice sisters. My mum is very kind. My dad is very successful. Do you have any siblings? Are they really interesting? | 1. I have one sister, she is very kind. My mom is really helpful. My dad is so funny. And I have one dog, he is quite old. 2. My garden is very big. It’s full of flowers and trees. My kitchen is quite old, but it’s very clean. Is your house old too? |
| Past simple (affirmative) | 1. I visited my family last month. We ate pizza together. What about last month? Did you eat at home or at a restaurant? 2. Last year was great. I studied English hard. I read six books. I went to the beach three times. I met my penfriend in Italy. | 1. I went to the supermarket. I bought some eggs. I made breakfast. I ate toast. I drank tea. What did you do yesterday morning? 2. I am happy to talk to you about last week. I visited my parents on Sunday. I bought some flowers for my mother. They were very beautiful. |
| Present simple + frequency adverb | 1. I usually wake up at 6. I eat breakfast sometimes, but not every day. Do you have breakfast in the morning? 2. People in my country often eat vegetables 5 times a week. How about your country? | 1. I usually go for a walk on Saturday morning. I always watch a movie on Sunday night. Sometimes I play with my dog. 2. In my country, people often eat breakfast at home and then lunch at work. Sometimes they order pizza for dinner. Where are you from? |
| Empty subject it | 1. I am in London, UK. It is 25 degrees Celsius here. How is the weather there? (Waiting for your answer…) 2. I was in my office yesterday. Here it was quiet and we are working on English lessons. Yesterday was a busy day in office. How was it at home? | 1. I’m in a small town in the mountains. It is cold here. How is the weather where you are? 2. I was on the beach. Here it was windy yesterday. How was it there? |
| enjoy + -ing | 1. I enjoy swimming in the ocean. Sometimes, I enjoy watching the sunset. Do you enjoy hiking or do you like lying on the beach? 2. I don’t enjoy reading books at night before bed, it makes me sleepy. What kind of exercise do you enjoy doing in the morning? | 1. When I am on holiday, I enjoy swimming in the sea. How about you? Do you enjoy playing games on holiday, like surfing or tennis? 2. I enjoy swimming. I like it because it’s good exercise and fun. What kind of sports do you enjoy, like cycling, dancing, or something else? |
| # | Grammar targets | Generation | |
|---|---|---|---|
| 1 | A | NEGATION: Can form negative statements of main verbs in the present continuous and present perfect with ’be’ and ’have’ + ’not/n’t’. | A: I’m not surprised about Carol Burnett, many people don’t have a clue about that. What I can’t understand is why some chefs aren’t working on making affordable meals for people. |
| B | CLAUSES: Can form conditional subordinate clauses with ’if’ + past simple, and would in the main clause, to talk about an imagined situation, often in the context of advice or opinion-giving. | A: If that were the case, I think sculpture would qualify as an Olympic sport, but I’m not sure if it would have been included if chess were removed from the Olympic programme long ago. | |
| 3 | A | NEGATION: Can form negative statements of main verbs in the present simple with ’don’t’ + main verb.; ADJECTIVES: Can form an increasing range of complex noun phrases with a superlative adjective + prepositional phrase, to talk about something unique.; MODALITY: Can use ’would’ to talk about imagined situations in the past. | I don’t know if it’s true, but I read that those cables have a lower transmission loss than any other material, that’s probably why they’re the best choice for that job, I’d imagine. |
| B | NEGATION: Can form negative statements of main verbs in the past simple with ’didn’t’ + main verb.; ADJECTIVES: Can use the irregular superlative adjective ’best’ in the phrase ’my best friend’.; MODALITY: Can use ’would’ to talk about the future in the past. | A: Yeah, he was my best friend, but I never thought he would get caught, didn’t he? I mean, he always said he’d retire a millionaire by the time he was 30, but I guess that didn’t happen. | |
| 6 | A | NEGATION: Can use uncontracted ’not’ for emphasis or in formal contexts.; NEGATION: Can use negative form ’can’t’.; ADJECTIVES: Can form an increasing range of complex noun phrases with a superlative adjective + prepositional phrase, to talk about something unique.; ADJECTIVES: Can form a limited range of complex noun phrases with a superlative adjective + prepositional phrase, to talk about something unique.; MODALITY: Can use ’would like’ to talk about wishes and preferences.; MODALITY: Can use question forms. | “I would love to read that book, can’t you just imagine sipping whiskey in a cup from the most romantic tea party in the south, that’s not something I can see happening anytime soon! |
| B | NEGATION: Can form negative statements of main verbs in the present continuous and present perfect with ’be’ and ’have’ + ’not/n’t’.; NEGATION: Can use uncontracted ’not’ for emphasis or in formal contexts.; ADJECTIVES: Can form a limited range of complex noun phrases with a superlative adjective + prepositional phrase, to talk about something unique.; ADJECTIVES: Can form an increasing range of complex noun phrases with a superlative adjective + prepositional phrase, to talk about something unique.; MODALITY: Can use ’would’ to talk about the future in the past.; MODALITY: Can use the affirmative form. | I would argue that ’Granny Style’ isn’t the best choice of shooting technique even if it’s preferred by physicists, I’m not sure it’s the most effective method for pros in the league. |
| CEFR level | EGP target | Generation |
|---|---|---|
| A1 | CLAUSES: Can combine two main declarative clauses using co-ordinating conjunctions (’and’, ’but’, ’or’). | It’s a heartwarming movie and very emotionally moving, especially in the way it portrays the relationships between the characters. |
| NOUNS: Can form noun phrases by pre-modifying a limited range of nouns with another noun. | A: That’s interesting, but can you tell me more about the portrayal of British soldiers on warships like the HMS Queen Elizabeth? | |
| A2 | PRESENT: Can use the present simple after ’if’ to talk about real and imagined situations. | A: I’m here. Don’t worry, we can take our time. If we didn’t have to meet, we probably would stay at home and watch another movie. |
| PRONOUNS: Can use ’this’ as a pronoun to refer to something that is happening now. | A: I completely agree, THIS is what makes the movie so special - the awesome connection between the actors and their characters. | |
| B1 | PRONOUNS: Can use determiners + premodifiers + ’ones’. | Actually, I’m not really in the mood for anything right now, but ones that have action and adventure are usually my favorite ones. |
| MODALITY: Can use ’it’ + ’be’ + ’important’ + (’that’) clause. | B: Of course, lots of action and imagination. A: Exactly, it is often very important that a movie has a well-structured narrative. |
Controllable Text Generation
Controllable text generation steers language models toward desired attributes, formats, audiences, and constraints while preserving useful, natural text.
See all 110 papers