
There are many scenarios where short- and long-term causal effects of an intervention are different. For example, low-quality ads may increase short-term ad clicks but decrease the long-term revenue via reduced clicks; search engines measured by inappropriate performance metrics may increase search query shares in a short-term but not long-term. This work therefore studies the long-term effect where the outcome of primary interest, or \textit{primary outcome}, takes months or even years to accumulate. The observational study of long-term effect presents unique challenges. First, the confounding bias causes large estimation error and variance, which can further accumulate towards the prediction of primary outcomes. Second, short-term outcomes are often directly used as the proxy of the primary outcome, i.e., the \textit{surrogate}. Notwithstanding its simplicity, this method entails the strong surrogacy assumption that is often impractical. To tackle these challenges, we propose to build connections between long-term causal inference and sequential models in machine learning. This enables us to learn \textit{surrogate representations} that account for the \textit{temporal unconfoundedness} and circumvent the stringent surrogacy assumption by conditioning on time-varying confounders in the latent space. Experimental results show that the proposed framework outperforms the state-of-the-art.