# TensorFlow Agents

A TensorFlow library for implementing, testing, and deploying contextual-bandit and reinforcement-learning algorithms.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Near-Optimal Regret for Oracle-Efficient Adversarial Contextual Bandits

DevFeed: [Near-Optimal Regret for Oracle-Efficient Adversarial Contextual Bandits](<https://devfeed.tech/articles/near-optimal-regret-for-oracle-efficient-adversarial-contextual-bandits-133174.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2611.17109>)

Author: Kiarash Banihashem, MohammadTaghi Hajiaghayi

Published: 2026-11-13T05:00:00Z

Content type: article

Language: en

Sources: [arXiv: Machine Learning](<https://devfeed.tech/sources/arxiv-machine-learning.md>)

Topics: [TensorFlow Agents](<https://devfeed.tech/topics/tensorflow-agents.md>)

Tags: [adversarial](<https://devfeed.tech/tags/adversarial.md>), [algorithm](<https://devfeed.tech/tags/algorithm.md>), [bandits](<https://devfeed.tech/tags/bandits.md>), [complexity](<https://devfeed.tech/tags/complexity.md>), [contextual-bandits](<https://devfeed.tech/tags/contextual-bandits.md>), [convex](<https://devfeed.tech/tags/convex.md>), [cs-ds](<https://devfeed.tech/tags/cs-ds.md>), [cs-lg](<https://devfeed.tech/tags/cs-lg.md>), [distribution](<https://devfeed.tech/tags/distribution.md>), [gradient-descent](<https://devfeed.tech/tags/gradient-descent.md>), [loss-functions](<https://devfeed.tech/tags/loss-functions.md>), [noise](<https://devfeed.tech/tags/noise.md>), [offline](<https://devfeed.tech/tags/offline.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [oracle](<https://devfeed.tech/tags/oracle.md>), [policies](<https://devfeed.tech/tags/policies.md>), [policy](<https://devfeed.tech/tags/policy.md>)

### AI overview

For contextual bandits with K actions, N policies, and sampleable i.i.d. contexts, the proposed oracle-efficient algorithm achieves expected regret O(√(KT log(2N)) log(2KT)) against the best policy in hindsight for loss sequences fixed before play. This improves the horizon dependence over prior oracle-efficient bounds from T^(2/3) to √T, up to logarithmic factors. It perturbs policy scores using Poisson-sampled auxiliary contexts and context-action-specific Laplace noise scales. The scales are chosen by minimizing a convex objective, then approximated with projected stochastic gradient descent using an exact offline cost-sensitive optimization oracle that returns the optimum value. Implicitly storing update-defining random draws avoids materializing the full scale table; the stated oracle complexity and other resource bounds are polynomial in T, K, and log(2N).

### Source excerpt

arXiv:2611.17109v1 Announce Type: new Abstract: We study contextual bandits with $K$ actions, a class of $N$ policies, and i.i.d.\ contexts from a distribution that the learner can sample. For any sequence of loss functions fixed before play, we give an oracle-efficient algorithm with expected regret $O(\sqrt{KT\log(2N)}\,\log(2KT))$ against the best policy in hindsight on the realized contexts. This improves the $T^{2/3}$ dependence on the horizon in prior oracle-efficient bounds and achieves the optimal regret rate in this setting up to logarithmic factors. Our algorithm perturbs policy scores using a Poisson sample of auxiliary contexts. At each sampled context, the perturbation assigned to an action is a Laplace noise draw multiplied by a scale specific to that context and action. We show that choosing these scales to minimize a convex objective determined by past observations yields the stated regret bound. We further approximate the minimizing scales by projected stochastic gradient descent using only an exact offline cost-sensitive optimization oracle that returns the optimum value. Since the table of scales can be large, the algorithm represents the SGD iterates implicitly by storing the random draws that determine each update and evaluates the scales only at queried contexts. Both the oracle complexity and the remaining resource bounds are polynomial in $T$, $K$, and $\log(2N)$.

## A Computationally Efficient and Rate-Optimal Algorithm for Adversarial Linear MDPs with (Aggregate) Bandit Feedback

DevFeed: [A Computationally Efficient and Rate-Optimal Algorithm for Adversarial Linear MDPs with (Aggregate) Bandit Feedback](<https://devfeed.tech/articles/a-computationally-efficient-and-rate-optimal-algorithm-for-adversarial-linear-mdps-with-aggregate-bandit-feedback-96977.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2610.30801>)

Author: Haolin Liu, Chen-Yu Wei, Hanbin Zhou

Published: 2026-10-23T04:00:00Z

Content type: article

Language: en

Sources: [arXiv: Machine Learning](<https://devfeed.tech/sources/arxiv-machine-learning.md>)

Topics: [Operations research and optimization](<https://devfeed.tech/topics/operations-research-and-optimization.md>), [TensorFlow Agents](<https://devfeed.tech/topics/tensorflow-agents.md>)

Tags: [adversarial](<https://devfeed.tech/tags/adversarial.md>), [aggregate](<https://devfeed.tech/tags/aggregate.md>), [algorithm](<https://devfeed.tech/tags/algorithm.md>), [cs-lg](<https://devfeed.tech/tags/cs-lg.md>), [feedback](<https://devfeed.tech/tags/feedback.md>), [linear](<https://devfeed.tech/tags/linear.md>)

### AI overview

For episodic linear MDPs with unknown transitions, adversarial losses, and bandit feedback, the authors report the first polynomial-time algorithm achieving √K regret, improving on prior results that offered either √K regret with computational inefficiency or K^(3/4) regret. The method reduces the problem to adversarial linear bandits over policies' expected feature vectors. Because that action set is unknown, an approximate separation oracle uses exploration to either produce executable policies for queried features or refine an outer approximation, while accounting for oracle imprecision. The algorithm requires only aggregate loss feedback; the authors say it is the first polynomial-time result for adversarial MDPs with aggregate feedback beyond the tabular case.

### Source excerpt

arXiv:2610.30801v1 Announce Type: new Abstract: We study episodic linear Markov decision processes with unknown transitions, adversarial losses, and bandit feedback. The state-of-the-art result for this setting (Liu et al., 2024) either achieves $\sqrt{K}$ regret with a computationally inefficient algorithm or achieves suboptimal $K^{3/4}$ regret, where $K$ is the number of episodes. Our work gives the first $\sqrt{K}$ regret with a polynomial-time algorithm. Our method reduces adversarial linear MDPs to adversarial linear bandits whose action set consists of policies' expected feature vectors. The central challenge is that this action set is unknown and can be estimated only through exploration. We address this challenge by constructing an approximate separation oracle for the action set that either generates executable policies from queried features, or refines an outer approximation of the action set. This approach draws inspiration from the reduction of van Erven et al. (2025) for linear contextual bandits and the oracle-efficient linear bandit algorithm of Ito et al. (2019), but additionally deals with the imprecision of the oracle. The resulting algorithm requires only aggregate loss feedback, and to our knowledge. This is the first polynomial-time algorithm for adversarial MDPs with aggregate feedback beyond the tabular case.

## Eluder-Dimension-Free Regret for Stage-Wise Constrained Contextual Bandits via Offline Regression

DevFeed: [Eluder-Dimension-Free Regret for Stage-Wise Constrained Contextual Bandits via Offline Regression](<https://devfeed.tech/articles/eluder-dimension-free-regret-for-stage-wise-constrained-contextual-bandits-via-offline-regression-96787.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2505.07101>)

Author: Haichen Hu, David Simchi-Levi, Navid Azizan

Published: 2026-10-23T04:00:00Z

Content type: article

Language: en

Sources: [arXiv: Machine Learning](<https://devfeed.tech/sources/arxiv-machine-learning.md>)

Topics: [TensorFlow Agents](<https://devfeed.tech/topics/tensorflow-agents.md>), [Reinforcement learning](<https://devfeed.tech/topics/reinforcement-learning.md>), [scikit-learn](<https://devfeed.tech/topics/scikit-learn.md>)

Tags: [bandits](<https://devfeed.tech/tags/bandits.md>), [contextual-bandits](<https://devfeed.tech/tags/contextual-bandits.md>), [cs-lg](<https://devfeed.tech/tags/cs-lg.md>), [dimension](<https://devfeed.tech/tags/dimension.md>), [free](<https://devfeed.tech/tags/free.md>), [offline](<https://devfeed.tech/tags/offline.md>), [regression](<https://devfeed.tech/tags/regression.md>), [stage](<https://devfeed.tech/tags/stage.md>), [stat-ml](<https://devfeed.tech/tags/stat-ml.md>)

### AI overview

CS-UCCB addresses contextual bandits with stage-wise risk constraints when only the chosen action's reward and cost are observed. It combines offline regression, cost confidence sets, and upper counterfactual confidence bounds; covering-entropy geometry controls cumulative cost uncertainty. For finite action sets, the stated conditions--polylogarithmic covering entropy for the reward and cost classes and polylogarithmic offline estimation error--yield, with high probability, feasibility at every round and \(\widetilde{\mathcal O}(\sqrt T)\) regret without an eluder-dimension term. The analysis also covers infinite action sets under an explicit reward-design condition and compares the bound with existing eluder-dimension bounds.

### Source excerpt

arXiv:2505.07101v4 Announce Type: replace-cross Abstract: Contextual bandits with stage-wise constraints model decisions that must control risk while learning from their outcomes. We study this problem when only the selected action's reward and cost are observed, with a general reward class and a convex class of nonlinear cost functions. We propose CS-UCCB, which combines offline regression, cost confidence sets, and upper counterfactual confidence bounds. Each regression fit defines a valid cost confidence set, while a geometry derived from covering entropy controls cumulative cost uncertainty along the sampled decisions. Under polylogarithmic covering entropy for both classes and polylogarithmic offline estimation error, the finite-action algorithm guarantees, with high probability, feasibility at every round and $\widetilde{\mathcal O}(\sqrt T)$ regret without an eluder-dimension term. We also extend the analysis to infinite actions under an explicit reward-design condition and compare our bound with existing eluder-dimension bounds.

## Simulated Spotify Listening Experiences for Reinforcement Learning with TensorFlow and TF-Agents

DevFeed: [Simulated Spotify Listening Experiences for Reinforcement Learning with TensorFlow and TF-Agents](<https://devfeed.tech/articles/simulated-spotify-listening-experiences-for-reinforcement-learning-with-tensorflow-and-tf-agents-7394.md>)

Original publisher: [Read original article](<https://blog.tensorflow.org/2023/10/simulated-spotify-listening-experiences-reinforcement-learning-tensorflow-tf-agents.html>)

Author: TensorFlow Blog (noreply@blogger.com)

Published: 2023-10-19T19:00:00Z

Content type: article

Language: en

Sources: [The TensorFlow Blog](<https://devfeed.tech/sources/the-tensorflow-blog.md>)

Topics: [TensorFlow Agents](<https://devfeed.tech/topics/tensorflow-agents.md>), [recommendation systems](<https://devfeed.tech/topics/recommendation-systems.md>), [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>), [data-engineering](<https://devfeed.tech/topics/data-engineering.md>), [Machine learning](<https://devfeed.tech/topics/machine-learning.md>), [Training AI Models](<https://devfeed.tech/topics/training-ai-models.md>), [TFX](<https://devfeed.tech/topics/tfx.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [documentation](<https://devfeed.tech/tags/documentation.md>), [keras](<https://devfeed.tech/tags/keras.md>), [learn](<https://devfeed.tech/tags/learn.md>), [machine-learning](<https://devfeed.tech/tags/machine-learning.md>), [offline](<https://devfeed.tech/tags/offline.md>), [reinforcement-learning](<https://devfeed.tech/tags/reinforcement-learning.md>), [tensorflow](<https://devfeed.tech/tags/tensorflow.md>), [tensorflow-agents](<https://devfeed.tech/tags/tensorflow-agents.md>), [tfx](<https://devfeed.tech/tags/tfx.md>)

### AI overview

Spotify describes using TensorFlow and TF-Agents to build an offline simulator for reinforcement-learning-based music recommendations. The simulator supported training and evaluating recommendation models and RL agents, with offline estimates reported as strongly correlated with live experimental results.

### Source excerpt

Posted by Surya Kanoria, Joseph Cauteruccio, Federico Tomasi, Kamil Ciosek, Matteo Rinaldi, and Zhenwen Dai - Spotify Introduction Many of our music recommendation problems involve providing users with ordered sets of items that satisfy users' listening preferences and intent at that point in time. We base current recommendations on previous interactions with our application and, in the abstract, are faced with a sequential decision making process as we continually recommend content to users. Reinforcement Learning (RL) is an established tool for sequential decision making that can be leveraged to solve sequential recommendation problems. We decided to explore how RL could be used to craft listening experiences for users. Before we could start training Agents, we needed to pick a RL library that allowed us to easily prototype, test, and potentially deploy our solutions. At Spotify we leverage TensorFlow and the extended TensorFlow Ecosystem (TFX, TensorFlow Serving, and so on) as part of our production Machine Learning Stack. We made the decision early on to leverage TensorFlow Agents as our RL Library of choice, knowing that integrating our experiments with our production systems would be vastly more efficient down the line. One missing bit of technology we required was an offline Spotify environment we could use to prototype, analyze, explore, and train Agents offline prior to online testing. The flexibility of the TF-Agents library, coupled with the broader advantages of TensorFlow and its ecosystem, allowed us to cleanly design a robust and extendable offline Spotify simulator. We based our simulator design on TF-Agents Environment primitives and using this simulator we developed, trained and evaluated sequential models for item recommendations, vanilla RL Agents (PPG, DQN) and a modified deep Q-Network, which we call the Action-Head DQN (AH-DQN), that addressed the specific challenges imposed by the large state and action space of our RL formulation. Through li

## Building a board game with the TFLite plugin for Flutter

DevFeed: [Building a board game with the TFLite plugin for Flutter](<https://devfeed.tech/articles/building-a-board-game-with-the-tflite-plugin-for-flutter-7389.md>)

Original publisher: [Read original article](<https://blog.tensorflow.org/2023/10/building-board-game-with-tflite-plugin-for-flutter.html>)

Author: TensorFlow Blog (noreply@blogger.com)

Published: 2023-10-18T17:00:00Z

Content type: tutorial

Language: en

Sources: [The TensorFlow Blog](<https://devfeed.tech/sources/the-tensorflow-blog.md>)

Topics: [Flutter](<https://devfeed.tech/topics/flutter.md>), [LiteRT](<https://devfeed.tech/topics/litert.md>), [Inference](<https://devfeed.tech/topics/inference.md>), [Reinforcement learning](<https://devfeed.tech/topics/reinforcement-learning.md>), [Tensorflow](<https://devfeed.tech/topics/tensorflow.md>), [TensorFlow Agents](<https://devfeed.tech/topics/tensorflow-agents.md>), [cross-platform](<https://devfeed.tech/topics/cross-platform.md>), [Mobile](<https://devfeed.tech/topics/mobile.md>), [board-game](<https://devfeed.tech/topics/board-game.md>), [Android](<https://devfeed.tech/topics/android.md>), [iOS](<https://devfeed.tech/topics/ios.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [building](<https://devfeed.tech/tags/building.md>), [cross-platform](<https://devfeed.tech/tags/cross-platform.md>), [flutter](<https://devfeed.tech/tags/flutter.md>), [games](<https://devfeed.tech/tags/games.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [inference](<https://devfeed.tech/tags/inference.md>), [ios](<https://devfeed.tech/tags/ios.md>), [learn](<https://devfeed.tech/tags/learn.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [plugin](<https://devfeed.tech/tags/plugin.md>), [reinforcement-learning](<https://devfeed.tech/tags/reinforcement-learning.md>), [tensorflow](<https://devfeed.tech/tags/tensorflow.md>), [tensorflow-agents](<https://devfeed.tech/tags/tensorflow-agents.md>), [tensorflow-lite](<https://devfeed.tech/tags/tensorflow-lite.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>), [tutorials](<https://devfeed.tech/tags/tutorials.md>)

### AI overview

This tutorial shows how to port a TensorFlow Lite reinforcement-learning board game to Flutter. It loads a converted model, runs inference to choose the next move, and renders the game for Android and iOS using the Flutter frontend and TensorFlow Lite plugin.

### Source excerpt

Posted by Wei Wei, Developer Advocate In our previous blog posts Building a board game app with TensorFlow: a new TensorFlow Lite reference app and Building a reinforcement learning agent with JAX, and deploying it on Android with TensorFlow Lite, we demonstrated how to train a reinforcement learning (RL) agent with TensorFlow, TensorFlow Agents and JAX respectively, and then deploy the converted TFLite model in an Android app using TensorFlow Lite, to play a simple board game 'Plane Strike'. While these end-to-end tutorials are helpful for Android developers, we have heard from the Flutter developer community that it would be interesting to make the app cross-platform. Inspired by the officially released TensorFlow Lite Plugin for Flutter recently, we are going to write one last tutorial and port the app to Flutter. Since we already have the model trained with TensorFlow and converted to TFLite, we can just load the model with TFLite interpreter: void _loadModel() async { // Create the interpreter _interpreter = await Interpreter.fromAsset(_modelFile); } Then we pass in the user board state and help the game agent identify the most promising position to strike next (please refer to our previous blog posts if you need a refresher on the game rules) by running TFLite inference: int predict(List<List<double>> boardState) { var input = [boardState]; var output = List.filled(_boardSize * _boardSize, 0) .reshape([1, _boardSize * _boardSize]); // Run inference _interpreter.run(input, output); // Argmax double max = output[0][0 ]; int maxIdx = 0; for (int i = 1; i < _boardSize * _boardSize; i++) { if (max < output[0][i]) { maxIdx = i; max = output[0][i]; } } return maxIdx; } That's it! With some additional Flutter frontend code to render the game boards and track game progress, we can immediately run the game on both Android and iOS (currently the plugin only supports these two mobile platforms). You can find the complete code on GitHub. If you want to dig digger, there ar

## Attend our first Developer Summit on Recommendation Systems

DevFeed: [Attend our first Developer Summit on Recommendation Systems](<https://devfeed.tech/articles/attend-our-first-developer-summit-on-recommendation-systems-7366.md>)

Original publisher: [Read original article](<https://blog.tensorflow.org/2023/05/attend-our-first-developer-summit-on-recommendation-systems.html>)

Author: TensorFlow Blog (noreply@blogger.com)

Published: 2023-05-26T14:30:00Z

Content type: news

Language: en

Sources: [The TensorFlow Blog](<https://devfeed.tech/sources/the-tensorflow-blog.md>)

Topics: [recommendation systems](<https://devfeed.tech/topics/recommendation-systems.md>), [Language models](<https://devfeed.tech/topics/language-models.md>), [TensorFlow Agents](<https://devfeed.tech/topics/tensorflow-agents.md>)

Tags: [developer](<https://devfeed.tech/tags/developer.md>), [event](<https://devfeed.tech/tags/event.md>), [generative-ai](<https://devfeed.tech/tags/generative-ai.md>), [large-language-models-llms](<https://devfeed.tech/tags/large-language-models-llms.md>), [recommendation-systems](<https://devfeed.tech/tags/recommendation-systems.md>), [tensorflow-agents](<https://devfeed.tech/tags/tensorflow-agents.md>), [tensorflow-ranking](<https://devfeed.tech/tags/tensorflow-ranking.md>), [tensorflow-recommenders](<https://devfeed.tech/tags/tensorflow-recommenders.md>)

### AI overview

Announcement of an online Developer Summit on Recommendation Systems covering TensorFlow recommendation products, LLM-augmented recommenders, and generative retrieval research.

### Source excerpt

Posted by Wei Wei, Developer Advocate Register for the Summit here! Recommendation systems are everywhere. They power our favorite websites, apps, and services, helping us find the things we enjoy. But how do modern recommenders work? What are the key components and how do they fit together? How can we make them even better? Since we launched our recommendation system landing page last year, we have heard many positive feedback from our developer community. While many developers find the new consolidated page very useful to get started with our suite of products, they are also eager to learn more about how to best leverage them to build powerful in-house recommenders for their own business needs. This is why we are very excited to announce our first-ever Developer Summit on Recommendation Systems (registration is open now). This event will be held online on June 9, 2023 10AM - 12:15PM US Pacific Time and it will bring together many Google engineers who authored our suite of products to share their insights and expertise in recommendation systems. At this summit, we will not only cover specific products (such as TensorFlow Recommenders, TensorFlow Ranking, and TensorFlow Agents), share ideas on augmenting recommenders with Large Language Models (LLMs), but also discuss Google's cutting edge recommendation system research (e.g., generative retrieval using generative AI techniques). This Developer Summit is the perfect event for anyone who wants to learn more about recommendation systems. Whether you're just getting started or a seasoned practitioner in this exciting domain, you're sure to find something valuable at this event. We look forward to (virtually) meeting you there!