mlsanityData to 14 Oct 2026

Dynamic Template Selection for Output Token Generation Optimization: MLP-Based and Transformer Approaches

arXiv 2511.20683 ↗First posted 17 Nov 2025cs.CLcited by 0

Not on the map. Why?

Abstract (arXiv)

Contemporary large language model deployments typically employ uniform prompting strategies across diverse query types, applying verbose response patterns to both complex analytical tasks and straightforward factual questions. This one-size-fits-all methodology leads to substantial token inefficiency, a concern amplified by the significant cost differential between input and output tokens--the latter commanding 4-8x higher prices across major providers. We present Dynamic Template Selection (DTS), which adaptively matches response templates to query complexity, achieving significant cost reductions without compromising response quality. We compared two routing approaches: a simple MLP that uses pre-computed embeddings and a more complex fine-tuned RoBERTa transformer. Through comprehensive evaluation on 1,000 MMLU questions, we find that the MLP router achieves 90.5% routing accuracy on held-out test data, marginally exceeding RoBERTa's performance (89.5%) despite utilizing 125M fewer parameters. Notably, our empirical analysis reveals provider-agnostic behavior in template selection--routing decisions generalize effectively across 3 major LLM providers (OpenAI GPT-4, Google Gemini, and Anthropic Claude), as validated through 9,000 production API calls. While routing accuracy remains consistent at 90.5% across providers, observed token reductions vary from 32.6% to 33.9%, reflecting provider-specific generation characteristics. This work contributes several key elements: formal problem formulation with theoretical grounding in machine learning, four algorithms with corresponding complexity analyses, and extensive empirical validation across production systems.

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 18 of its 20 references that are in the map. First posted on arXiv 17 Nov 2025.

Builds on

18 of 20 references.

References · 18

  1. 2020Language Models are Few-Shot Learnerscited by 32,419
  2. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
  3. 2015Distilling the Knowledge in a Neural Networkcited by 10,324
  4. 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
  5. 2020Measuring Massive Multitask Language Understandingcited by 7,963
  6. 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,708
  7. 2022Large Language Models are Zero-Shot Reasonerscited by 4,374
  8. 2019DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lightercited by 4,307
  9. 2021The Power of Scale for Parameter-Efficient Prompt Tuningcited by 3,795
  10. 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,780
  11. 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,442
  12. 2023Tree of Thoughts: Deliberate Problem Solving with Large Language Modelscited by 3,211
6 more
  1. 2021What Makes Good In-Context Examples for GPT-3?cited by 1,195
  2. 2022Large Language Models Are Human-Level Prompt Engineerscited by 1,045
  3. 2023Graph of Thoughts: Solving Elaborate Problems with Large Language Modelscited by 886
  4. 2021Learning To Retrieve Prompts for In-Context Learningcited by 648
  5. 2021True Few-Shot Learning with Language Modelscited by 344
  6. 2023Iterated Decomposition: Improving Science Q&A by Supervising Reasoning Processescited by 15

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2025Dynamic LLM Routing and Selection based on User Preferences: Balancing Performance, Cost, and Ethics
  2. 2026Dynamic Model Routing and Cascading for Efficient LLM Inference: A Survey
  3. 2026Dynamic Mixed-Precision Routing for Efficient Multi-step LLM Interaction
  4. 2026RouteNLP: Closed-Loop LLM Routing with Conformal Cascading and Distillation Co-Optimization
  5. 2026Dynamic Routing as a New Dimension for Test-time Versatility of LLMs
  6. 2025LLM Bandit: Cost-Efficient LLM Generation via Preference-Conditioned Dynamic Routing
  7. 2024TensorOpera Router: A Multi-Model Router for Efficient LLM Inference
  8. 2026Rethinking Quality in Large Language Model Routing: Security-Conditioned Model-and-Budget Selection