search
HomeTechnology peripheralsAIFrom Transformer to Diffusion Model, learn about reinforcement learning methods based on sequence modeling in one article

Large-scale generative models have brought huge breakthroughs to natural language processing and even computer vision in the past two years. Recently, this trend has also affected reinforcement learning, especially offline reinforcement learning (offline RL), such as Decision Transformer (DT)[1], Trajectory Transformer (TT)[2], Gato[3], Diffuser[4], etc. This method regards reinforcement learning data (including status, action, reward and return-to-go) as a string of destructured sequence data, and models these sequence data as the core task of learning. These models can be trained using supervised or self-supervised learning methods, avoiding the unstable gradient signals in traditional reinforcement learning. Even using complex policy improvement and value estimation methods, they show very good performance in offline reinforcement learning.

This article will briefly talk about these reinforcement learning methods based on sequence modeling. In the next article, I will introduce our newly proposed Trajectory Autoencoding Planner (TAP), which uses Vector Quantised Variational AutoEncoder (VQ-VAE) is a method for sequence modeling and efficient planning in latent action space.

Transformer and Reinforcement Learning

The Transformer architecture [5] was proposed in 2017 and slowly triggered a revolution in natural language processing. The subsequent BERT and GPT-3 gradually The combination of self-supervised Transformer continues to be pushed to new heights. While properties such as few-shot learning continue to emerge in the field of natural language processing, it also begins to spread to fields such as computer vision [6][7] .

However, for reinforcement learning, this process does not seem to be particularly obvious before 2021. In 2018, the multi-head attention mechanism was also introduced into reinforcement learning [8]. This type of work is basically applied in fields similar to semi-symbolic (sub-symbolic) to try to solve the problem of reinforcement learning generalization. Since then, such attempts have been tepid. According to the author's personal experience, Transformer actually does not show a stable and overwhelming advantage in reinforcement learning, and it is also difficult to train. In one of our work using Relational GCN for reinforcement learning in 20 years [9], we actually tried Transformer behind the scenes, but it was basically much worse than the traditional structure (similar to CNN), and it was difficult to stably train and obtain a usable one. policy. Why Transformer is not compatible with traditional online reinforcement learning (online RL) is still an open question. For example, Melo [10] explained that it is because the parameter initialization of traditional Transformer is not suitable for reinforcement learning. I will not discuss it more here.

In mid-2021, the release of Decision Transformer (DT) and Trajectory Transformer (TT) set off a new wave of Transformer applications in RL. The idea of ​​these two works is actually very straightforward: If Transformer and online reinforcement learning algorithms are not very compatible, how about simply treating reinforcement learning as a self-supervised learning task? Taking advantage of the fact that the concept of offline reinforcement learning is also very popular, both of these works have locked their main target tasks into modeling offline datasets, and then use this sequence model for control and decision-making.

For reinforcement learning, the so-called sequence is composed of state (state) s, action (action) From Transformer to Diffusion Model, learn about reinforcement learning methods based on sequence modeling in one article, reward (reward) r and value ( value) v The trajectory composed of From Transformer to Diffusion Model, learn about reinforcement learning methods based on sequence modeling in one article. The value is currently generally replaced by return-to-go, which can be regarded as a Monte Carlo estimation. The offline data set consists of these trajectories. The generation of trajectories is related to the dynamics of the environment and the behavior policy. The so-called sequence modeling is to model the probability distribution (distribution) that generates this sequence, or strictly speaking, some of the conditional probabilities. From Transformer to Diffusion Model, learn about reinforcement learning methods based on sequence modeling in one article

Decision Transformer

DT's approach is to model a mapping from past data and values ​​to actions (return-conditioned policy), which is to model the mathematical expectation of the conditional probability of an action. From Transformer to Diffusion Model, learn about reinforcement learning methods based on sequence modeling in one article. This idea is very similar to Upside Down RL [11], but it is very likely that the direct motivation behind it is to imitate GPT2/3's method of completing downstream tasks based on prompts. One problem with this approach is that there is no systematic way to decide what the best target value is. However, the authors of DT found that even if the target value is set to the highest return in the entire data set, the final performance of DT can be very good. From Transformer to Diffusion Model, learn about reinforcement learning methods based on sequence modeling in one article

From Transformer to Diffusion Model, learn about reinforcement learning methods based on sequence modeling in one article

Decision Transformer, Figure 1

For those with a background in reinforcement learning Humanly speaking, it is very counter-intuitive that a method like DT can achieve strong performance. If methods such as DQN and Policy Gradient can only regard the neural network as a fitting function that can be used for interpolation generalization, then policy improvement and valuation in reinforcement learning are still the core of constructing policies. It can be said that DT is entirely based on neural networks. The entire process behind how it connects a potentially unrealistically high target value to an appropriate action is completely black box. The success of DT can be said to be somewhat unreasonable from the perspective of reinforcement learning, but I think this is the charm of this kind of empirical research. The author believes that the generalization ability of neural networks, or Transformers, may exceed the previous expectations of the entire RL community.

DT is also very simple among all sequence modeling methods, and almost all core problems of reinforcement learning are solved inside Transformer. This simplicity is one of the reasons why it is currently the most popular. However, its black-box nature also causes us to lose a lot of grip on the algorithm design level, and some achievements in traditional reinforcement learning are difficult to incorporate into it. The effectiveness of these results has been repeatedly confirmed in some very large-scale experiments (such as AlphaGo, AlphaStar, VPT).

Trajectory Transformer

TT’s approach is more similar to the traditional model-based reinforcement learning (model-based RL) planning method. In terms of modeling, it discretizes the elements in the entire sequence, and then uses a discrete auto-regressive method like GPT-2 to model the entire offline data set. This allows it to model the continuation of any given sequence minus the return-to-go. Because it models the distribution of subsequent sequences, TT actually becomes a sequence generation model. By looking for a sequence with better value estimation in the generated sequence, TT can output an "optimal plan". As for the method of finding the optimal sequence, TT uses a method commonly used in natural language: a variant of beam search. Basically, it is to always retain the optimal part of the sequence

in the expanded sequence, and then find the next optimal sequence set From Transformer to Diffusion Model, learn about reinforcement learning methods based on sequence modeling in one article based on them. From Transformer to Diffusion Model, learn about reinforcement learning methods based on sequence modeling in one article

From the perspective of reinforcement learning, TT is not as unorthodox as DT. What’s interesting about it is that (like DT) it completely abandons the causal graph structure of the original Markov Decision Process in reinforcement learning. Previous model-based methods, such as PETS, world model, dramerv2, etc., all follow the definition of policy function, transfer function, reward function, etc. in the Markov process (or implicit Markov), that is, the condition of the state distribution is The state of the previous step, and actions, rewards, and values ​​are all determined by the current state. The entire reinforcement learning community generally believes that this can improve sample efficiency, but such a graph structure may actually be a constraint. The transition from RNN to Transformer in the field of natural language and from CNN to Transformer in the field of computer vision actually reflects: as the data increases, letting the network learn the graph structure by itself is more conducive to obtaining a better-performing model.

From Transformer to Diffusion Model, learn about reinforcement learning methods based on sequence modeling in one article

##DreamerV2, Figure 3Since TT basically hands over all sequence prediction tasks to With Transformer, Transformer can learn better graph structures from data more flexibly. As shown in the figure below, the behavioral strategies modeled by TT show different graph structures according to different tasks and data sets. The left side of the figure corresponds to the traditional Markov strategy, and the right side of the figure corresponds to an action moving average strategy.

From Transformer to Diffusion Model, learn about reinforcement learning methods based on sequence modeling in one article

Trajectory Transformer, Figure 4

Transformer Powerful sequence modeling The ability brings higher long sequence modeling accuracy. The figure below shows that TT's predictions over 100 steps still maintain high accuracy, while single-step prediction models that follow Markov properties quickly collapse due to the problem of superposition of prediction errors. .

From Transformer to Diffusion Model, learn about reinforcement learning methods based on sequence modeling in one article

##Trajectory Transformer, Figure 2TT Although different from traditional methods in terms of specific modeling and prediction It is different, but the prediction ability it provides still leaves a good starting point for other results that will be integrated into reinforcement learning in the future. However, TT has an important problem in prediction speed: because it needs to model the distribution of the entire sequence, it discretizes all elements in the sequence according to dimensions. This means that a 100-dimensional state needs to occupy 100 elements in the sequence. position, which makes it easy for the actual length of the sequence being modeled to become particularly long. For Transformer, its computational complexity for sequence length N is , which makes sampling a future prediction from TT very expensive. Even task TT with less than 100 dimensions requires several seconds or even tens of seconds to make a one-step decision. Such a model is difficult to put into real-time robot control or online learning. From Transformer to Diffusion Model, learn about reinforcement learning methods based on sequence modeling in one articleGato

Gato is a "generalist model" published by Deepmind. It is actually a cross-modal multi-task generation model. Using the same Transformer, it can complete various tasks from natural language question answering, picture description, playing video games to robot control. Gato's approach to modeling continuous control is basically similar to TT. It's just that Gato is not doing reinforcement learning in a strict sense. It just models the sequence data generated by the expert strategy, and then when it takes action, it only needs to sample the next action. It is actually an imitation of the expert strategy.

From Transformer to Diffusion Model, learn about reinforcement learning methods based on sequence modeling in one article

Gato BlogOther sequence generation models: Diffusion model

The diffusion model (Diffusion Model) can be said to be very popular in the field of image generation recently. DALLE-2 and Stable Diffusion are both based on it for image generation. Diffuser has also applied this method to offline reinforcement learning. The idea is similar to TT. It first models the conditional distribution of the sequence, and then samples possible future sequences based on the current state.

Diffuser has greater flexibility than TT: it can let the model fill in the middle path while setting the starting point and end point, so that it can be goal-driven (rather than maximizing rewards) function) control. It can also mix multiple goals and a priori conditions for achieving the goals to help the model complete the task.

From Transformer to Diffusion Model, learn about reinforcement learning methods based on sequence modeling in one article

##Diffuser Figure 1Diffuser is also quite subversive compared to the traditional reinforcement learning model. The generated plan does not unfold gradually on a timeline, but becomes gradually more precise from vagueness in the sense of the entire sequence. Further research on the diffusion model itself is also a hot topic in computer vision, and there is likely to be a breakthrough in the model itself in the next few years.

However, the diffusion model itself currently has a special flaw compared to other generation models, that is, its generation speed is slower than other generation models. Many experts in related fields believe that this may be alleviated in the next few years. However, the generation time of several seconds is currently difficult to accept for scenarios where reinforcement learning requires real-time control. Diffuser proposed a method to improve the generation speed: add a small amount of noise from the previous step's plan to regenerate the next step's plan, but doing so will reduce the performance of the model to a certain extent.

The above is the detailed content of From Transformer to Diffusion Model, learn about reinforcement learning methods based on sequence modeling in one article. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:51CTO.COM. If there is any infringement, please contact admin@php.cn delete
ai合并图层的快捷键是什么ai合并图层的快捷键是什么Jan 07, 2021 am 10:59 AM

ai合并图层的快捷键是“Ctrl+Shift+E”,它的作用是把目前所有处在显示状态的图层合并,在隐藏状态的图层则不作变动。也可以选中要合并的图层,在菜单栏中依次点击“窗口”-“路径查找器”,点击“合并”按钮。

ai橡皮擦擦不掉东西怎么办ai橡皮擦擦不掉东西怎么办Jan 13, 2021 am 10:23 AM

ai橡皮擦擦不掉东西是因为AI是矢量图软件,用橡皮擦不能擦位图的,其解决办法就是用蒙板工具以及钢笔勾好路径再建立蒙板即可实现擦掉东西。

谷歌超强AI超算碾压英伟达A100!TPU v4性能提升10倍,细节首次公开谷歌超强AI超算碾压英伟达A100!TPU v4性能提升10倍,细节首次公开Apr 07, 2023 pm 02:54 PM

虽然谷歌早在2020年,就在自家的数据中心上部署了当时最强的AI芯片——TPU v4。但直到今年的4月4日,谷歌才首次公布了这台AI超算的技术细节。论文地址:https://arxiv.org/abs/2304.01433相比于TPU v3,TPU v4的性能要高出2.1倍,而在整合4096个芯片之后,超算的性能更是提升了10倍。另外,谷歌还声称,自家芯片要比英伟达A100更快、更节能。与A100对打,速度快1.7倍论文中,谷歌表示,对于规模相当的系统,TPU v4可以提供比英伟达A100强1.

ai可以转成psd格式吗ai可以转成psd格式吗Feb 22, 2023 pm 05:56 PM

ai可以转成psd格式。转换方法:1、打开Adobe Illustrator软件,依次点击顶部菜单栏的“文件”-“打开”,选择所需的ai文件;2、点击右侧功能面板中的“图层”,点击三杠图标,在弹出的选项中选择“释放到图层(顺序)”;3、依次点击顶部菜单栏的“文件”-“导出”-“导出为”;4、在弹出的“导出”对话框中,将“保存类型”设置为“PSD格式”,点击“导出”即可;

GPT-4的研究路径没有前途?Yann LeCun给自回归判了死刑GPT-4的研究路径没有前途?Yann LeCun给自回归判了死刑Apr 04, 2023 am 11:55 AM

Yann LeCun 这个观点的确有些大胆。 「从现在起 5 年内,没有哪个头脑正常的人会使用自回归模型。」最近,图灵奖得主 Yann LeCun 给一场辩论做了个特别的开场。而他口中的自回归,正是当前爆红的 GPT 家族模型所依赖的学习范式。当然,被 Yann LeCun 指出问题的不只是自回归模型。在他看来,当前整个的机器学习领域都面临巨大挑战。这场辩论的主题为「Do large language models need sensory grounding for meaning and u

ai顶部属性栏不见了怎么办ai顶部属性栏不见了怎么办Feb 22, 2023 pm 05:27 PM

ai顶部属性栏不见了的解决办法:1、开启Ai新建画布,进入绘图页面;2、在Ai顶部菜单栏中点击“窗口”;3、在系统弹出的窗口菜单页面中点击“控制”,然后开启“控制”窗口即可显示出属性栏。

ai移动不了东西了怎么办ai移动不了东西了怎么办Mar 07, 2023 am 10:03 AM

ai移动不了东西的解决办法:1、打开ai软件,打开空白文档;2、选择矩形工具,在文档中绘制矩形;3、点击选择工具,移动文档中的矩形;4、点击图层按钮,弹出图层面板对话框,解锁图层;5、点击选择工具,移动矩形即可。

强化学习再登Nature封面,自动驾驶安全验证新范式大幅减少测试里程强化学习再登Nature封面,自动驾驶安全验证新范式大幅减少测试里程Mar 31, 2023 pm 10:38 PM

引入密集强化学习,用 AI 验证 AI。 自动驾驶汽车 (AV) 技术的快速发展,使得我们正处于交通革命的风口浪尖,其规模是自一个世纪前汽车问世以来从未见过的。自动驾驶技术具有显着提高交通安全性、机动性和可持续性的潜力,因此引起了工业界、政府机构、专业组织和学术机构的共同关注。过去 20 年里,自动驾驶汽车的发展取得了长足的进步,尤其是随着深度学习的出现更是如此。到 2015 年,开始有公司宣布他们将在 2020 之前量产 AV。不过到目前为止,并且没有 level 4 级别的 AV 可以在市场

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.