token-based optimization