US stocks rose on Tuesday as investors considered whether the latest data showing that prices rose less than expected last month would prompt the Federal Reserve to change its aggressive stance on inflation.

The S&P 500 and the Nasdaq 100 finished the volatile session with gains after data indicated that the worst of the inflationary pressures had likely passed. While the soft consumer price index data sparked a brief rally in equities, the gains were quickly erased as investors turned their attention to what the latest figures mean for the Fed's rate hike path.

Treasuries rose, with the policy-sensitive two-year yield falling as much as 24 basis points following the release of the CPI data. Fed Chair Jerome Powell's closely watched measure of service prices excluding energy and rents continued to moderate.

While the Fed is widely expected to raise interest rates by half a percentage point on Wednesday, investors will be watching what officials say for additional policy cues. Swap markets now favor a quarter-point increase as early as the Fed's February meeting.

Nonetheless, some investors are wary of exaggerating the latest CPI print.