As times change, so do attitudes about sex: Acceptance of same-sex relationships has tripled in the last 20 years. Acceptance of premarital sex is also at an all-time high. These are two of the findings of a 40-year, ongoing survey of sexual attitudes.

The researchers attribute the results to generational changes in attitude, with Millennials leading the way.

“The changes are primarily due to generation — suggesting people develop their sexual attitudes while young, rather than everyone of all ages changing at the same time,” said Jean M. Twenge, the study's lead author, in a statement.

Acceptance of same-sex relationships has tripled in the last 20 years. And acceptance of premarital sex is also at an all-time high.

The biggest change in 20th century attitudes was the shift between those of the GI generation (born 1901-1924) and the Boomers (born 1946-64), as the entire nation's ideas about sex before marriage were transformed.

The percentage of people who believed premarital sex was “not wrong at all” rose steadily from 29% in the early 1970s to 42% in the 1980s and 1990s, when it leveled off. In the 21st century, it began to rise again — from 49% in the 2000s up to 58%, a solid majority, between 2010 and 2012.

But it's the acceptance of homosexuality that has changed the most. Thirteen percent of the population supported same sex relationships in 1990; by 2012 acceptance of gay and lesbian relationships had risen to 44%.

The information in the survey comes from over 33,000 adults responding to the General Social Survey (GSS) which is administered every two years by the National Opinion Research Center (NORC) at the University of Chicago.

Increasing numbers of sexual partners is another area of change. This number rose steadily between the GI generation and Generation X (born 1965-1981) but has dropped among Millennials (born 1982-1999). It was 2.16 partners per person for the GI generation, rose to 11.68 for Boomers, but is only 8.26 for Millennials.

So while Millennials appear to be more tolerant about sex than their parents, they practice it with fewer partners. What's the reason for this?

Twenge, a professor in the Department of Psychology at San Diego State University, has a theory about the Millennial thought process.

“This is consistent with their image as a tolerant, individualistic generation accepting others' choices and making their own.” Twenge believes that these numbers are linked to growing cultural individualism in the U.S. “When the culture places more emphasis on the needs of the self and less on social rules, more relaxed attitudes toward sexuality are the almost inevitable result.”

The study appears in Archives of Sexual Behavior.