  In an attempt to improve on our earlier W3 theory [J. Chem. Phys. {\bf 120},
4129 (2004)] we consider such refinements as more accurate estimates for the
contribution of connected quadruple excitations ($\hat{T}_4$), inclusion of
connected quintuple excitations ($\hat{T}_5$), diagonal Born-Oppenheimer
corrections (DBOC), and improved basis set extrapolation procedures. Revised
experimental data for validation purposes were obtained from the latest version
of the ATcT (Active Thermochemical Tables) Thermochemical Network. We found
that the CCSDTQ$-$CCSDT(Q) difference converges quite rapidly with the basis
set, and that the formula
1.10[CCSDT(Q)/cc-pVTZ+CCSDTQ/cc-pVDZ$-$CCSDT(Q)/cc-pVDZ] offers a very reliable
as well as fairly cost-effective estimate of the basis set limit $\hat{T}_4$
contribution. The largest $\hat{T}_5$ contribution found in the present work is
on the order of 0.5 kcal/mol (for ozone). DBOC corrections are significant at
the 0.1 kcal/mol level in hydride systems. . Based on the accumulated
experience, a new computational thermochemistry protocol for first-and
second-row main-group systems, to be known as W4 theory, is proposed. Our W4
atomization energies for a number of key species are in excellent agreement
(better than 0.1 kcal/mol on average, 95% confidence intervals narrower than 1
kJ/mol) with the latest experimental data obtained from Active Thermochemical
Tables. A simple {\em a priori} estimate for the importance of post-CCSD(T)
correlation contributions (and hence a pessimistic estimate for the error in a
W2-type calculation) is proposed.
