Side Effect
In programming, any effect a function or operation produces on external state beyond its return value, such as file writes, database modifications, or network requests. The treatment of side effects is a core distinction between functional and imperative programming paradigms.
Timeline (last 90 days)
In tool-calling scenarios, if each candidate is a complete agent trajectory, N candidates mean N sets of side effects (N writes, emails, charges), because eliminating a candidate cannot undo side effects that have already occurred.
Pure text generation is idempotent, so generating a hundred candidates at worst wastes tokens without changing the world state; but candidate trajectories that include tool calls each genuinely change external state.
A pure function is a function that always returns the same output for the same input and produces no observable side effects: it does not modify external state, does not read or write files or databases, does not make network requests, and does not write logs.
Hidden side effects refer to a function secretly modifying external state beyond its return value (such as altering global variables, modifying a passed-in list, or writing to a file).
It is recommended to consolidate side-effect operations into clearly defined boundary layers, keeping core business logic pure in order to facilitate unit testing and reduce debugging costs.
All Facts (5)
In tool-calling scenarios, if each candidate is a complete agent trajectory, N candidates mean N sets of side effects (N writes, emails, charges), because eliminating a candidate cannot undo side effects that have already occurred.
50%UnverifiedPure text generation is idempotent, so generating a hundred candidates at worst wastes tokens without changing the world state; but candidate trajectories that include tool calls each genuinely change external state.
50%UnverifiedA pure function is a function that always returns the same output for the same input and produces no observable side effects: it does not modify external state, does not read or write files or databases, does not make network requests, and does not write logs.
50%UnverifiedHidden side effects refer to a function secretly modifying external state beyond its return value (such as altering global variables, modifying a passed-in list, or writing to a file).
50%UnverifiedIt is recommended to consolidate side-effect operations into clearly defined boundary layers, keeping core business logic pure in order to facilitate unit testing and reduce debugging costs.
50%