Page MenuHomePhabricator

[summaries] Regenerate articles summaries with new prompt, model & filters
Closed, DeclinedPublic5 Estimated Story Points

Description

Background

In T375364 we created AI generated article summaries based for a list of ~8,000 popular/important articles on Wikipedia. We used a specific prompt and the Aya 32B model from Cohere. Since that time, we've updated the prompt and the model has been updated to Aya expanse. This task describes the work to re-generate those summaries using a new prompt, new model, and additional filters based on article categories.

User story

As a reader I expect AI generated summaries to be high quality and written in a tone appropriate for Wikipedia.

Requirements

New Prompt

## Task
Summarize the text below at a 7-th grade reading level, in {language}, using 100 words or less. 

## Guidelines
When writing the summary it is crucial to stick to ALL of the following guidelines:
* Simplicity: The summary should be easy to read and understand. Aim for a 7-th grade reading level; and
* Fluency: The summary should be grammatically correct. Provide only the summary itself as output and refrain from using humorous or imaginative titles; and
* Meaning preservation: The summary should be factually consistent with the input text capturing its essential points.  Do not expand content beyond its original length if it is already brief; and
* Language:  The summary should be written in {language}. If you detect yourself starting to switch to another language, stop and restart in {language}; and
* Tone: The summary should be written in a style and tone appropriate for Wikipedia. Avoid any editorializing, opinions, or expressive language about the subject and ensure the tone remains encyclopedic, neutral, and professional.

## Input text
{input_text}

New model:
Aya-expanse (tbd: hosted on either LiftWing or using the Cohere API endpoint).

Additional filters
A. Murders (crimes generally in the last 100 years)
B. Terrorist acts (e.g. hotel mumbai shooting, Las Vegas sniper)
C. Political parties that still exist
D. Terrorist groups
E. Mental health (suicide, depression)
F. Controversial subjects (bomb making; chemical weapons)

Note: the filters above have been implemented in this export script:
https://gitlab.wikimedia.org/repos/web/simple-summary-server/-/commit/7629ef97373b1dda6f7499ee70303e232c65cab7#90cc2aec681ec423b02cd67ec1df372adc43c64b_0_11

Acceptance Criteria

  • New filters have been added to the summary generating criteria
  • Summaries have been regenerated using new Aya expand model on Liftwing and outputted as JSON files.
  • Summaries have been updated in the Extension:ArticleSummaries extension.

Event Timeline

ovasileva claimed this task.
ovasileva triaged this task as High priority.
ovasileva moved this task from Incoming to Q4 on the Web-Team board.

@Jdrewniak - added additional list - let's do the best matching we can via categories. If there's no good match, we can also filter manually. Assigning to you for the follow-up steps

Jdrewniak renamed this task from Update summaries to [summaries] Regenerate articles summaries with new prompt, model & filters.Mar 31 2025, 4:56 PM
Jdrewniak updated the task description. (Show Details)
Jdlrobson changed the task status from Open to In Progress.Apr 2 2025, 8:09 PM

This is needed for launch. @Jdrewniak to start a refinement thread.

@Jdrewniak we are kicking off sprint Wednesday! Please prioritize filling this card out and starting a refinement thread as otherwise this won't happen!

Jdlrobson-WMF set the point value for this task to 5.May 21 2025, 5:32 PM
Jdlrobson-WMF moved this task from Q4 to Sprint Backlog on the Web-Team board.
Jdlrobson-WMF changed the task status from In Progress to Open.Jun 2 2025, 5:53 PM

The ML team is working towards efficienlty serving LLMs in production. In the context of that work we have been using vllm which is an inference optimization engine.
While we are working on that, we wanted to validate its use by regenerating the summaries found in the ArticleSummaries extension using aya-expanse-32b model using the prompt attached in this task. The summaries for enwiki for these articles in can be found in the attached file

We are also working our way towards providing the additional evaluation metrics for the summaries that were used by the Research team. An example can be found in T395246#10882715. Let us know if this would be useful.
Shout out to @kevinbazira for tackling this.

Jdrewniak removed Jdrewniak as the assignee of this task.

Thank you for all the work on this @isarantopoulos unfortunately this hypothesis has been stalled, and I'm resolving all related subtasks. Hopefully this feature still gets to be explored in the coming months with a new team :)