How shallow can a basement be for an accessory dwelling unit (ADU)
Per the International Building Code (IBC): 

"The portion of a building having its floor subgrade (below ground level) on all sides. This definition of “Basement” is limited in application to the provisions of Section 1612."

"BASEMENT. A story that is not a story above grade plane (see “Story above grade plane”). 
This definition of “Basement” does not apply to the provisions of Section 1612 for flood loads."

The definition is in the code that is used by your jurisdiction, which is almost surely the IBC. However, your city, county or state may have revised it to their desire as well. You need to determine the code that applies to your area to verify.

It would seem that a basement is any level whose floor that is not entirely at or above grade, and is not related at all to the wall heights