We spend about 3.5% of GDP on defense [1], and coincidentally about 3.5% on R&D [2]. People tend to wildly overestimate how large the modern US defense budget is. It's only around 13% of federal spending [3]!
[1] https://data.worldbank.org/indicator/MS.MIL.XPND.GD.ZS?locat... [2] https://data.worldbank.org/indicator/GB.XPD.RSDV.GD.ZS?locat... [3] https://federalbudgetinpictures.com/where-does-all-the-money...