  Surgical robot task automation has been a promising research topic for
improving surgical efficiency and quality. Learning-based methods have been
recognized as an interesting paradigm and been increasingly investigated.
However, existing approaches encounter difficulties in long-horizon
goal-conditioned tasks due to the intricate compositional structure, which
requires decision-making for a sequence of sub-steps and understanding of
inherent dynamics of goal-reaching tasks. In this paper, we propose a new
learning-based framework by leveraging the strong reasoning capability of the
GPT-based architecture to automate surgical robotic tasks. The key to our
approach is developing a goal-conditioned decision transformer to achieve
sequential representations with goal-aware future indicators in order to
enhance temporal reasoning. Moreover, considering to exploit a general
understanding of dynamics inherent in manipulations, thus making the model's
reasoning ability to be task-agnostic, we also design a cross-task pretraining
paradigm that uses multiple training objectives associated with data from
diverse tasks. We have conducted extensive experiments on 10 tasks using the
surgical robot learning simulator SurRoL~\cite{long2023human}. The results show
that our new approach achieves promising performance and task versatility
compared to existing methods. The learned trajectories can be deployed on the
da Vinci Research Kit (dVRK) for validating its practicality in real surgical
robot settings. Our project website is at: https://med-air.github.io/SurRoL.
