Back to technology news
Smartphones & Gadgets

Mozilla Refines Shake to Summarize Prompt for Recipe Webpages

Following the rollout of Firefox’s Shake to Summarize feature to Android devices in May, Mozilla engineers undertook a closer look at the modeling work behind the feature. In a previous blog post, the team discussed their model selection process. Now that Shake to Summarize has been available on both iOS and Android for several months, they set out to outline their approach to prompt development, beginning with clearly defining what the large language model should do for each content type.

The team quickly discovered that what constitutes a good summary depends largely on the content being summarized. For novels, a useful summary provides a quick plot overview without verbatim details, whereas for recipe websites the summary should include ingredients and key steps as written. A summary that merely states a recipe calls for "some broth and some spices" would be inadequate if it omits specific quantities such as 4 cups of vegetable broth, a tablespoon of oregano, and a teaspoon of thyme.

To address this, the engineers compiled a list of article types — recipes, news, how-to, review, research, opinion, personal blog, and fiction — and for each type gave a brief description of what a good summary would look like. They wrapped this list in general instructions to ground the model in the task and created an initial prompt that prioritized servings, total time, ingredients list, key steps, and tips for recipes, along with mobile formatting rules of concise language and three-sentence maximum paragraphs.

Testing revealed the initial prompt mostly worked well, except for recipes, where the model tended to summarize too much, often leaving out key ingredients or the recipe entirely. For example, when summarizing a lentil soup recipe the model returned a narrative overview that described the dish but omitted the ingredient list and steps, making it unusable as a quick recipe reference. The summary was accurate but not useful for users seeking the recipe itself without reading through narrative preamble.

To fix this, the engineers developed a separate prompt containing only recipe instructions and routed recipe summarization requests to use it rather than the general prompt. They used structured data embedded in each webpage to identify page categories deterministically without additional inference overhead, and maintained lightweight recipe guidance in the general prompt as a fallback for missing or inaccurate metadata. After this change, the model returned a structured summary including servings, total time, prep time, cook time, ingredients, instructions, and tips, making the recipe immediately usable.

The team found that routing specific article types to dedicated prompts significantly improved results, confirming that summarization is not a monolithic task. Even with a single category-specific prompt, the new system was more than twice as likely to return a complete and accurate recipe summary. The experience reinforced that improving AI systems is not solely about building larger models; reducing ambiguity, narrowing the task, and designing systems that help the model succeed yield some of the biggest gains, and that within the right harness smaller, open source models can deliver great value.

Source credits

By Bryan Johns from Mozilla Blog. Edited by SetuGeo.

CC BY-SA 3.0 or later

More technology news

Browse all technology news