With the explosive growth of numbers of Internet users and network traffic, the capacity of cellular mobile communication is already limited. In order to solve the contradiction between the increasing demand for high capacity and the limited resource, traffic offloading technology makes full use of the existing network, which offloads part of traffic from the cellular network into the other network and carries on the cooperation between networks, to improve the capacity of the cellular network greatly. Traffic offloading becomes one of the hot topics in the future research of wireless communication technology. In this paper, based on reinforcement learning, we propose a novel reinforcement learning algorithm for traffic offloading in dense heterogeneous network. Based on the previous experience and performance gain of the user offloading, this algorithm considers the system throughput of each state, and finds the optimal WiFi network access point (AP) by calculating the reward value. We also derive the optimal policy of traffic offloading decision to maximize the throughput of the system. Simulation results show that the reinforcement learning for traffic offloading can effectively avoid the collision caused by over offloading and rapid deterioration of system performance. Our scheme can effectively implement the adaptive traffic offloading control policy and achieve the cooperation between LTE and WiFi network guaranteeing the quality of service for users. The overall throughput of the dense heterogeneous network also reaches the maximum.