APO-DD: Dialogue Disentanglement via Reflective Optimization of Multi-Component Prompts
In multi-party chat, interleaved dialogues make it difficult to identify the context of each utterance. Dialogue disentanglement separates these dialogues to support dialogue analysis and response generation. Prompt refinement can improve large language models' (LLMs') accuracy on this task, but manually finding effective prompts for each LLM requires extensive trial and error. We propose APO-DD, which adapts GEPA to optimize prompts using execution traces and reflections on failed decisions. It updates task instructions directly and chat representations through automatically generated formatting functions. We compare optimizing either component alone or both. With Qwen3.5-9B, the best optimized prompt achieves an average score of 68.7 across seven evaluation metrics on Ubuntu IRC, compared with 57.5 for the best manually refined prompt. It also outperforms manually refined prompts on other chat domains without further optimization. For this model, optimizing task instructions alone does not always improve accuracy over the initial prompts. Our results suggest that exploring chat representation as an optimization target may yield higher accuracy than optimizing task instructions alone. Our code is available at https://anonymous.4open.science/r/DB6B.