Ordinance retrieval should map paraphrased resident questions to the same code section. Which fine-tuning signal helps?
Select an answer to reveal the explanation.
Short Explanation
When residents phrase the same ordinance question in different ways, you want retrieval to bring them to the same code section. Contrastive embedding loss pulls those paraphrases together, helping your search find the right section.
Full Explanation
Ordinance retrieval must map paraphrased resident questions—“Can I build a fence?” versus “What’s the rear-yard enclosure rule?”—to the same code section despite differences in wording. Fine-tuning embeddings with contrastive loss pulls paraphrased questions and their matching section texts together in vector space while pushing unrelated sections apart, improving civic retrieval. Predicting next tokens in unrelated novels optimizes literary language modeling rather than ordinance similarity. Training only generative chat without an embedding similarity objective may produce fluent answers, but it does not train the retrieval index geometry. Pushing paraphrases of the same section as far apart as possible in vector space reverses the contrastive goal and harms retrieval. For the exam, identify contrastive embedding fine-tuning as the signal for paraphrase-to-section retrieval; the other approaches focus on unrelated novel prediction, chat without an embedding objective, or separating matching paraphrases. One caveat: contrastive batches need hard negatives from nearby but distinct code sections, or the model may collapse similar ordinances together. As a practical check, build paraphrase query–section pairs from resident FAQ logs, fine-tune with contrastive loss, then measure recall@k and section accuracy on held-out paraphrases before replacing the ordinance search index.