U.S. stocks fluctuated on Tuesday, with investors measuring upbeat earnings from the banking sector against concern from the Federal Reserve that valuations on small-cap and high-flying names might be "stretched."

JPMorgan Chase and Goldman Sachs Group climbed after posting better-than-expected quarterly results. Facebook and Yahoo fell after the Fed, in its monetary report, called valuations stretched for smaller social media and biotechnology stocks. Lorillard declined after Reynolds American said it would purchase its rival cigarette maker for about $25 billion.

Read MoreFed slaps stocks with unusually targeted comments on valuation froth

We have "echoes of irrational exuberance, but in an entirely different context," said Art Hogan, chief market strategist at Wunderlich Securities, referring to Yellen's comments about biotech and social media stocks, and relating them to a phrase used by then-Fed Chairman Alan Greenspan in the 1990s during the dot-com bubble.

Read MoreBiotech, social stocks weak after Yellen warning

In semi-annual testimony before the Senate Banking Committee, Fed chair Janet Yellen said the central bank's monetary stimulus was still necessary, given "significant slack" in the labor market and that inflation remained under the Fed's target.

Read MoreYellen: No 'magical formula' for rate inceases