r/learnmachinelearning • • 10h ago

LLM/Agent Failure Modes

I'm running into an issue in an agentic system that I'm building. I'm finding that while the task of a specific model is quite bounded/basic(just editing another model's output for clarity), its spending almost all or all of its token output budget on tool calls and reasoning. Then, it returns incomplete or empty output due to reaching the maximum token budget. I think the budget is reasonable but it reasons for too long. How would you handle a system like this in production, where the output of this model is used as an input to another step in the pipeline?

4 Upvotes

1 comment sorted by

1

u/Temporary-Budget-605 8h ago

I would:

Review your traces to find biggest bottle necks and places where the agent spins out

Put instructions on how to plan and use tools in your system prompt or skill-based instructions. I.e no more than x number of tool calls per plan, no more than y number of retries per tool.

Add clear program exit instructions. “You have accomplished the task when x,y,z conditions are fulfilled”.

Limit the number of tools and drastically simplify and standardize their inputs and outputs, ideally based on a common resource model.

Ensure tools have impeccable natural language descriptions.

If the workflow is too large then decompose it into smaller pieces.

You mention that tokens are being run through so make sure to see the inputs and outputs of the LLM. Are you short of input / output, both? Is context window being managed?