India were believing that the pure stone has a spiritual value so that by using substraction as a design method, Indian temple builders, carved into stone cliffs or they carved out of pilled rocks to make an art of subtraction. Therefore, it can be said that the structure of rock-cut temples based on nature’s supply. The caves at Bhaja, which is carved during the mid 1st century bce, were the earliest Indian rock-cut temples.
Religious beliefs in India, Hinduismi Buddhism and Jainism, came into prominence and the earliest architectural prototypes, which are reworked for Hindu and Jain buildings, were produced through Buddhism. Also, buddhists sponsored projects for Chaitya halls and Viharas (monasteries) which is magnificent rock-cut temples carved from a single masses of stone . The largest and most ornate of the early rock-cut chaitya halls was built around 120 ce near Bjaha.
The tradition of rock-cut works reached its climax during the Gupta period in the 4th and 5th centuries. They inspired the great cave Viharas (monasteries). Gupta dynasty used same carving techniques, which India had before, to produce freestanding temples. They designed the temple 17 which is a small square temple with a colonnaded porch. It is almost as if a rock-cut temple and again created by extraction from the cliff and then it was transported to the site. The Gupta also left caves which has similarities with temple 17.
In the age of the Gupta, the first important masonry temples were built and they were like pyramids over small sanctuaries. At Mahabalipuram (town in India), the shore temples were built around 720. They were the first structural temples built in durable materails in the Gupta region. Most of the Mahabalipuram temples were carved from single Stones but looked like they had been built from pieces, so, they were like pyramids.
Reference: World Architecture: A Cross-Cultural History by Richar Ingersoll.