Cashin, UBS' director of floor operations at the NYSE, told CNBC's Courtney Reagan around midafternoon that the comments came during an exchange between Yellen and Rep. Carolyn Maloney (D-New York).
"Maloney pressed pretty hard as to what would induce you to consider holding back, pausing, or taper the tapering. What the market liked about it was that Yellen wasn't dismissive of it, was willing to discuss it. Which then indicated she felt the Fed really was flexible and would adjust depending on circumstances, not just markets but economics."
Cashin said Yellen's comments can't take all the credit for Tuesday's big gains, but they "put the icing on the cake."
He added that some technical factors are also bullish for stocks.
(Read more: Yellen just added pressure on emerging markets)