Local approximate inference algorithms