Sometimes, things are not always based on how one was trained or how he learned or knew stuffs, especially in Bleach.
So, its entirely possible that either Zaraki unconsciously materialized Yachiru, or Yachiru herself materialized herself using Zaraki's Reiatsu (even though Zanpakuto spirit are...