The SFT Phase #
The first hurdle was the data scarcity. Since there isn't a massive open-source corpus of Tunisian folk poetry, I had to curate a high-quality, small-scale dataset. The goal here wasn't just to give the model examples, but to teach it the structural constraints of the poetry.
-
Dataset Curation: I gathered a few hundred authentic poems and paired them with detailed linguistic explanations.
-
Prompt Engineering: Instead of simple "complete this poem" prompts, I used a format that explained the meter and the specific regional dialectal markers.
-
Fine-Tuning: I ran the SFT process to shift the model's internal probability distribution. This stopped the model from constantly correcting "incorrect" dialectal spelling back into Modern Standard Arabic.
Moving to RL for Nuance #
SFT gets the model to mimic the style, but it doesn't necessarily make the poetry "good" or culturally resonant. That's where Reinforcement Learning comes in. I set up a reward model based on three specific criteria: adherence to the folk meter, use of authentic regional vocabulary, and the avoidance of classical Arabic clichés.
The process looked like this:
- The model generates five variations of a poem based on a theme.
- A human-in-the-loop (or a highly tuned critic model) ranks them.
- The reward signal pushes the model toward the "folk" identity and away from the "academic" identity.
The Technical Takeaway #
The most interesting part of this AI workflow was seeing the tension between the model's pre-existing knowledge and the new fine-tuned data. Gemini has a massive "gravity" toward standard Arabic. To overcome this, you can't just provide examples; you have to actively penalize the model for being "too correct" in a formal sense.
For anyone attempting a similar deep dive into niche languages or dialects, the lesson is that SFT provides the vocabulary, but RL provides the "soul" or the stylistic intuition. If you're building an LLM agent for cultural preservation, don't stop at fine-tuning. The reward function is where the actual personality of the agent is forged. This approach turned a model that was guessing into one that could actually compose verse that felt authentic to the region. Google AI is basically just playing a game of probability 1d ago
Demis Hassabis is taking over the entire AI steering wheel at 1d ago
Why do AI models keep pushing the Japanese Communist Party? 2d ago
AI is eroding critical thinking in students faster than we can 2d ago
[OpenAI spent months training models that were actively 3d ago](/en/news/5466/)
[Google Search Defaults: Why AI Integration is the New Monopoly 4d ago](/en/news/5300/)
Next Predicting churn is useless unless you actually act on the data →
All Replies (0) #
No replies yet — be the first!