Conversational Control with Ontologies for Large Language Models: A Lightweight Framework for Constrained Generation
Organizations: Université de Lorraine, CNRS, LORIA, Nancy, France · Université Sorbonne Nord, LIPN, CNRS, UMR 7030, F-93430, Villetaneuse, France
Abstract
Conversational agents based on Large Language Models (LLMs) have recently emerged as powerful tools for human-computer interaction. Nevertheless, their black-box nature implies challenges in predictability and a lack of personalization, both of which can be addressed by controlled generation. This work proposes an end-to-end method to obtain modular and explainable control over LLM outputs through ontological definitions of aspects related to the conversation. Key aspects are modeled and used as constraints; we then further fine-tune the LLM to generate content accordingly. To validate our approach, we explore two tasks that tackle two key conversational aspects: the English proficiency level and the polarity profile of the content. Using a hybrid fine-tuning procedure on seven state-of-the-art, open-weight conversational LLMs, we show that our method consistently outperforms pre-trained baselines, even on smaller models. Beyond quantitative gains, the framework remains model-agnostic, lightweight, and interpretable, enabling reusable control strategies that can be extended to new domains and interaction goals. This approach enhances alignment with strategy instructions and demonstrates the effectiveness of ontology-driven control in conversational systems.
Figures & tables
| Model Name | Model Type | Classes (Num. Classes) | Accuracy | Weighted F1 |
|---|---|---|---|---|
| CEFR Levels Classifier | Decision Tree | A1, A2, B1, B2, C1, C2 (6) | 0.66 | 0.65 |
| Load Classifier | RoBERTa | Loaded, Non Loaded (2) | 0.94 | 0.93 |
| Polarity Classifier | RoBERTa | Negative, Neutral, Positive (3) | 0.75 | 0.71 |
| Model | Proficiency-Level Control | Polarity Profile Control | |||||||
| F1 Std | F1 Range | Acc | MAE | F1 Std | F1 Range | Acc | MCC | ||
| Pre-Trained Baselines | |||||||||
| Llama3-8B | 0.06 ±0.10 | 0.00-0.29 | 0.16 | 2.42 | - | 0.14 ±0.12 | 0.00-0.31 | 0.19 | 0.02 |
| Llama3.1-8B | 0.14 ±0.07 | 0.09-0.30 | 0.19 | 1.98 | - | 0.18 ±0.12 | 0.06-0.31 | 0.23 | 0.08 |
| Llama3.2-3B | 0.12 ±0.09 | 0.04-0.30 | 0.18 | 2.19 | - | 0.19 ±0.09 | 0.08-0.35 | 0.23 | 0.06 |
| Phi-3.5-mini | 0.13 ±0.07 | 0.04-0.24 | 0.16 | 2.13 | - | 0.18 ±0.07 | 0.08-0.27 | 0.19 | 0.03 |
Controllable Text Generation
Controllable text generation steers language models toward desired attributes, formats, audiences, and constraints while preserving useful, natural text.
See all 109 papers